Issues with "Like" type Grid Filters in Admin

Components

Labels

Description

Currently LIKE type Admin Grid Filters won't properly work when we use " _ " or " % " in the search query. Both will be treated as "wildcards" by MySQL since not properly escaped.

Below is example of SQL used when we put " % " in Filter Search:

SELECT COUNT AS count
FROM News
LEFT JOIN CategoryItems ON CategoryItems.ItemResourceId = News.ResourceId
LEFT JOIN Category ON Category.CategoryId = CategoryItems.CategoryId
LEFT JOIN Images img ON img.ResourceId = News.ResourceId AND img.DefaultImg = 1
LEFT JOIN PermCache perm ON perm.CategoryId = CategoryItems.CategoryId
LEFT JOIN PortalUser u ON News.CreatedById = u.PortalUserId
LEFT JOIN NewsCustomData cust ON News.ResourceId = cust.ResourceId
WHERE ((PrimaryCat = 1) AND (perm.PermId = 1)) AND (((`News`.`Title` LIKE "%%%")))
LIMIT 0,1

Context Information

None

Additional information (do not use)

None

Attachments

1

Activity

Dmitry Andrejev January 12, 2010 at 4:05 AM

Closing completed tasks.

Dmitry Andrejev November 13, 2009 at 7:07 PM

Was fixed along with other task in 5.0.2-B1 development.

Moving Target version to 5.0.2

Alex November 10, 2009 at 5:40 PM

Fix committed to [b]5.0.x branch/b. Commit Message:

Fixes #0000097: Issues with "Like" type Grid Filters in Admin

Dmitry Andrejev November 10, 2009 at 5:35 PM

Tested Ok!

Alex November 10, 2009 at 11:14 AM

With this patch you will be able to search for "_" and "%" symbols in fields, and "?" and "*" will only work as wildcards. Tested on front-end simple search and in admin column filter.

Fixed

Details

Priority

Assignee

Reporter

Patch Instructions

Patches must be submitted through Phabricator.

External issue ID

External issue URL

Fix versions

Affects versions

Created June 19, 2009 at 7:55 PM
Updated December 29, 2024 at 9:23 PM
Resolved January 12, 2010 at 4:05 AM