Project:Views
Version:5.x-1.x-dev
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

Correct me if I'm wrong, but searching with Views Fastsearch appears to be case sensitive. Shouldn't this be (at least) optional?

Comments

#1

Priority:normal» critical

It's taken me two days to figure out that this was the reason my searches weren't working.

#2

Title:case sensitive» searches are case sensitive
Category:feature request» bug report

This is a significant difference from the core search in Drupal, so I'm looking at this as a bug.

#3

this looks like views wasn’t handling the case where a query that had been processed but still contained strings that db_query uses for arg substitution where passed to db_query. this led to unintended substitutions.

for example, views would pass this sql:

SELECT node.nid FROM node node  WHERE (UPPER(node.title) LIKE UPPER('%s is not the substitution you were looking for%')) AND (node.type IN ('droids')) AND (node.status = '1')   LIMIT 0, 12

to db_query, and the '%s' would get replaced with the first element of $args, which if that happened to be node.title, mysql would see:

SELECT node.nid FROM node node  WHERE (UPPER(node.title) LIKE UPPER('node.title is not the substitution you were looking for%')) AND (node.type IN ('droids')) AND (node.status = ‘1’)   LIMIT 0, 12

looks like case sensitive, but isn’t.

a possible fix just converts '%(s|d|f|b)' --> '%%(s|d|b|f)' before the query is passed to db_query by views like this in views_build_view:

<?php
$query
= preg_replace('/(%(s|d|b|f))/', '%%$2', $query);
?>

#4

Project:Views Fast Search» Views
Version:5.x-2.0» 5.x-1.x-dev

Here is Justin's fix in patch form. It applies against 5.x-1.x-dev and 5.x-1.6.

AttachmentSize
views_267021.patch 453 bytes

#5

Status:active» needs review

Needs review.

#6

Status:needs review» fixed

This bug was fixed in -dev ages ago.

#7

That this was fixed "ages ago" makes me want a new release in a big way. Meanwhile, thanks for the info, merlinofchaos.

#8

sun posted an issue with a list of what he wants to do for a 1.7 release. If you'd like to help, see http://drupal.org/node/208855

The list is shockingly long =)

#9

Status:fixed» closed (fixed)

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

nobody click here