Support:Search for EMPTY Email reversed

From dispage wiki

Jump to:navigation, search
INFO
Bug
dispage extension Enhanced Search
extension release3.1.03a
priority{{{priority}}}
SugarCRM version
SugarCRM editions
Server OS
PHP version
DB Engine
MySQL version
Fix version3.1.03b



Issue:

Searches wtih EMPTY search option checked in an Any Email field return records with NOT EMPTY emails.

Dually, if NOT search option is also checked, they erroneusly return records EMPTY emails .


Reasons:

Subquery fields need to have the NOT option reverted when filtered by EMPTY option.


Solution:

The manual fix is reported below.


1- Locate the code

elseif($type == 'html' && $customField) {
    continue;
}

in "<sugar_dir>/include/SearchForm/SearchForm2.php". If default CR are preserved, it is at line 757 of FULL version and 711 of BASIC.


2- Add the following code after it

elseif ($search_empty && $parms['operator'] == 'subquery') {
      if (!isset($parms['NOT'])) $parms['NOT'] = false;
      $parms['NOT'] = !$parms['NOT'];
}
Navigation
dispage support
Toolbox