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.

Files: 
CommentFileSizeAuthor
views_handler_filter_numeric.inc_.diff507 bytesSteveTheRed
Test request sent.
[ View ]

Comments

Yeah, this is a problem. Can we get a commit?

Status:Active» Reviewed & tested by the community

Patch applied, no more error. Works for me.

Status:Reviewed & tested by the community» Fixed

Great! THanks for providing the patch and someone testing it!

This code will be changed in 8.x anyway.

Status:Fixed» Reviewed & tested by the community

Please commit this into 7.x too if at all possible.

Similar bug report http://drupal.org/node/1882652 .

Status:Reviewed & tested by the community» Fixed

This got committed!

Status:Fixed» Closed (fixed)

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