I notice that, the exposed filters text field is case sensitive.

when i enter "france" it return no result because the body content only has the keyword "France" , i'm suggesting that it should be less sensitive on the case itself because when user do a filter search, rarely will use uppercase and therefore the content with uppercase keyword will not be return.

please feel free change the issue category accordingly, either it is a feature request or a bug report

CommentFileSizeAuthor
#2 views-1.6.x.patch1.56 KBJhef.Vicedo
exposed_filter.JPG5.31 KBFoodster

Comments

najibx’s picture

Title: Exposed Filters case sensitive » Exposed Filters is case sensitive

Yes, I can confirm this. Looking forward for fixing. BTW, i am using latest Dev version.

Jhef.Vicedo’s picture

Version: 5.x-1.6-beta5 » 5.x-1.6
Component: Miscellaneous » Code
Category: feature » bug
Priority: Normal » Critical
Status: Active » Needs review
StatusFileSize
new1.56 KB

Actually, the behavior looks case sensitive but it is not. Try searching for keywords that do not start with "d", "s", "f" and "b". Search works perfectly well.

I think the problem is with the replacement of the placeholders, which are %d, %s, %f and %b, with the actual data when the code reaches the _views_view_build_filters() call inside the _views_build_query() function. The resulting query contains LIKE conditions that are not properly escaped.

Here's the patch that adds extra "%%" in the "contains", "words", "allwords", "ends" and "not" operators.

Jhef.Vicedo’s picture

Priority: Critical » Normal
cghobbs’s picture

I've tried this patch and so far seems to have fixed the issue and has not created any new ones that I can see.

marcingy’s picture

Status: Needs review » Reviewed & tested by the community

I have just encountered this issue and the patch seems to fix the problem with no knock on effects

kehan’s picture

got this issue too and the patch applies cleanly and fixes it for me. Any thoughts about applying this to head?

mroswell’s picture

Does this patch fix the
"d", "s", "f" and "b"
problem?

ekrispin’s picture

Patched it and it fixed the problem. Thanks!

merlinofchaos’s picture

I believe this patch is not necessary in the -dev version of Views 1, where the %d/b/f/s problem is already fixed. Could someone confirm this?

kulfi’s picture

I can not find a 5.x -dev release? For 5.x1.6:

- I'm getting an error if searching for 'contains' 'b'.
- Also, the exposed filters are case sensitive.

Jhef.Vicedo’s picture

@merlin

I have tested the -dev version and you're right, problem is already fixed. Would there be any new release? thanks,

Matthieu’s picture

The patch works well, thanks a lot.

Matthieu

marcingy’s picture

Version: 5.x-1.6 » 5.x-1.x-dev
Status: Reviewed & tested by the community » Fixed

Fixed in dev version

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.