From d79e67a630ec7964e4cb79625cab460bc295c107 Mon Sep 17 00:00:00 2001 From: spirit Date: Fri, 23 Sep 2016 09:17:27 +0300 Subject: [PATCH] CRM-19401 - more generalized solution ---------------------------------------- * CRM-19401: Integer list option custom fields do not render properly in reports https://issues.civicrm.org/jira/browse/CRM-19401 --- CRM/Report/Form.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/CRM/Report/Form.php b/CRM/Report/Form.php index 40f63a4642..95ffc12c84 100644 --- a/CRM/Report/Form.php +++ b/CRM/Report/Form.php @@ -3706,15 +3706,6 @@ ORDER BY cg.weight, cf.weight"; case 'Int': $curFilters[$fieldName]['operatorType'] = CRM_Report_Form::OP_INT; $curFilters[$fieldName]['type'] = CRM_Utils_Type::T_INT; - - // CRM-19401 fix - if ($customDAO->html_type == 'Select') { - $options = CRM_Core_PseudoConstant::get('CRM_Core_BAO_CustomField', 'custom_' . $customDAO->cf_id, array(), 'search'); - if ($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; - } - } break; case 'Money': @@ -3755,6 +3746,15 @@ ORDER BY cg.weight, cf.weight"; $curFilters[$fieldName]['type'] = CRM_Utils_Type::T_STRING; } + // CRM-19401 fix + if ($customDAO->html_type == 'Select' && !array_key_exists('options', $curFilters[$fieldName])) { + $options = CRM_Core_PseudoConstant::get('CRM_Core_BAO_CustomField', 'custom_' . $customDAO->cf_id, array(), 'search'); + if ($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; + } + } + if (!array_key_exists('type', $curFields[$fieldName])) { $curFields[$fieldName]['type'] = CRM_Utils_Array::value('type', $curFilters[$fieldName], array()); } -- 2.25.1