Update Form.php
authorgiovannidalmas1967 <44569254+giovannidalmas1967@users.noreply.github.com>
Mon, 29 Oct 2018 15:39:53 +0000 (16:39 +0100)
committerGitHub <noreply@github.com>
Mon, 29 Oct 2018 15:39:53 +0000 (16:39 +0100)
Custom fields with data type 'String' cannot be displayed in Reports->Contacts->Contituent Summary->Summery Fields->Filters Tab. This should be related to function addCustomDataToColumns(). Putting a different control for variable '$option' in case 'String' seems to solve the issue

CRM/Report/Form.php

index 325eb064a4403278f2532321129bc7a5835756b4..463afe59b843753472abae045bd8a136f3e47b4d 100644 (file)
@@ -3935,7 +3935,7 @@ ORDER BY cg.weight, cf.weight";
           $curFilters[$fieldName]['type'] = CRM_Utils_Type::T_STRING;
 
           $options = CRM_Core_PseudoConstant::get('CRM_Core_BAO_CustomField', 'custom_' . $customDAO->cf_id, array(), 'search');
-          if ($options !== FALSE) {
+          if ((is_array($options) && count($options)!=0) || (!is_array($options) && $options !== FALSE)) {
             $curFilters[$fieldName]['operatorType'] = CRM_Core_BAO_CustomField::isSerialized($customDAO) ? CRM_Report_Form::OP_MULTISELECT_SEPARATOR : CRM_Report_Form::OP_MULTISELECT;
             $curFilters[$fieldName]['options'] = $options;
           }