[Vtigercrm-developers] greater/less than filters in 6.3

Alan Bell alan.bell at libertus.co.uk
Mon Aug 24 12:26:59 GMT 2015


in 6.3 if you set up a filter on a number field, for example leads with 
employees  greater than 10 or opportunities with value less than or 
equal to 5000 you will find that it doesn't work (try on demo.vtiger.com 
add a lead with 5 employees and one with 15 employees and set up a 
filter showing everything with more than 10 emploeyes, both will be listed).
this is due to this code in include/QueryGenerator/QueryGenerator.php 
around line 1030:


                         } else if(in_array($field->getFieldDataType(), 
$inEqualityFieldTypes)){
                 if ($operator == 'g' || $operator == 'l') {
                     $value = substr($value, 4);
                 } else if ($operator == 'h' || $operator == 'm') {
                     $value = substr($value, 5);
                 }

it is setting $value to be a substring of $value and as $value contains 
a number like 5000 or 10 for example, it ends up setting $value to 0. 
Commenting out the lines that change $value fixes the system.
What exactly was this code attempting to achieve in the first place? Why 
would you ever want to reduce $value to 4 or 5 characters?

Alan.


More information about the vtigercrm-developers mailing list