Closed (fixed)
Project:
Views (for Drupal 7)
Version:
7.x-3.3
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
3 Apr 2012 at 23:42 UTC
Updated:
7 Apr 2013 at 22:10 UTC
From a vanilla Drupal 7 install, with a MySQL database and only ctools and views modules added beyond core, add a filter to a view on any numeric field (nid is usually available ;-> ) and select "Regular expression" as the operator.
The resulting SQL will include:
nid RLIKE '', '', ''
The extra quoted strings before the value we care about make SQL sad.
This appears to be happening because views_handler_filter_numeric::value is an array with 'min', 'max' and 'value' elements, of which only the third is applicable here.
The fix appears to be fairly simple (select only the array element we need, 'value'), and I've attached a diff thereof.
| Comment | File | Size | Author |
|---|---|---|---|
| views_handler_filter_numeric.inc_.diff | 507 bytes | SteveTheRed |
Comments
Comment #1
mgriebe commentedYeah, this is a problem. Can we get a commit?
Comment #2
kari.kaariainen commentedPatch applied, no more error. Works for me.
Comment #3
dawehnerGreat! THanks for providing the patch and someone testing it!
This code will be changed in 8.x anyway.
Comment #4
kari.kaariainen commentedPlease commit this into 7.x too if at all possible.
Comment #5
monish_deb commentedSimilar bug report http://drupal.org/node/1882652 .
Comment #6
dawehnerThis got committed!