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

Manu urs manu.k at vtiger.com
Tue Aug 25 06:11:25 GMT 2015


Hi  Alan ,

This above mentioned code is to  fetch only number  from search bar value
which also contain the   html special characters during the  Listview
 inequality test for   > , < , >=, and <=.

Please replace the line number 1028 to 1033  in
include/QueryGenerator/QueryGenerator.php  file by

      global $default_charset;
>                 $table = get_html_translation_table(HTML_ENTITIES,
> ENT_COMPAT,$default_charset);
>                 $chars = implode('', array_keys($table));
>                         if (preg_match("/[{$chars}]+/", $value) === 1){
>                          if ($operator == 'g' || $operator == 'l') {
>                             $value = substr($value, 4);
>                         } else if ($operator == 'h' || $operator == 'm') {
>                             $value = substr($value, 5);
>                         }
>                        }



This will fix your issue
<http://trac.vtiger.com/cgi-bin/trac.cgi/ticket/8617>.

Regards,
Manu Urs



On Mon, Aug 24, 2015 at 5:56 PM, Alan Bell <alan.bell at libertus.co.uk> wrote:

> 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.
> _______________________________________________
> http://www.vtiger.com/
>



-- 
Regards,
Manu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20150825/63ea0adc/attachment.html>


More information about the vtigercrm-developers mailing list