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.

views_handler_filter_numeric.inc_.diff507 bytesSteveTheRed
None View
Members fund testing for the Drupal project. Drupal Association Learn more


mgriebe’s picture

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

kari.kaariainen’s picture

Status: Active » Reviewed & tested by the community

Patch applied, no more error. Works for me.

dawehner’s picture

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.

kari.kaariainen’s picture

Status: Fixed » Reviewed & tested by the community

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

monish_deb’s picture

Similar bug report .

dawehner’s picture

Status: Reviewed & tested by the community » Fixed

This got committed!

Status: Fixed » Closed (fixed)

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