Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Minor
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.2.0
-
Fix Version/s: 4.2.1
-
Component/s: CiviCRM Search, Core CiviCRM
-
Labels:
-
Versioning Impact:Major (incompatible API change)
-
Documentation Required?:None
-
Funding Source:Core Team Funds
Description
When loading the Group Contact Cache, the SQL is generated by CRM_Contact_Form_Search_Custom_Group and modified to add the group_id into the select clause. The regex in the preg_replace() is not generic enough. It needs to account for a) whitespace before the SELECT, and b) an optional DISTINCT keyword.
The attached patch fixes this. A better solution would be to have the SQL generated properly for this case by CRM_Contact_Form_Search_Custom_Group as discussed at http://forum.civicrm.org/index.php/topic,25842.0.html