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 CreditAttribution: mgriebe commentedYeah, this is a problem. Can we get a commit?
Comment #2
kari.kaariainen CreditAttribution: 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 CreditAttribution: kari.kaariainen commentedPlease commit this into 7.x too if at all possible.
Comment #5
monish_deb CreditAttribution: monish_deb commentedSimilar bug report http://drupal.org/node/1882652 .
Comment #6
dawehnerThis got committed!