0

after upgrading CiviCRM 5.5.1 in the filters of all reports, custom fields (type text) are not visibile. They are only visible only select fields. In column tab are instead visibile. And they are visibile in Advanced Search. Is it a bug?

Thanks

  • Did you check if the custom fields are searchable? – Pradeep Nayak Oct 5 '18 at 10:09
  • Yes, custom fields are searchable. – masetto Oct 6 '18 at 12:26
2

I had the same problem. I tried to create a custom field (String data type) and checked it as searchable but it didn't appear in Filters tab.

Checking and debugging the code I found the function addCustomDataToColumns() (in /sites/all/modules/civicrm/CRM/report/Form.php) which deals with Custom Fields Data

I noticed that String, StateProvince and Country data type are handled in the same way and this probably makes String data type Field not be visible in Filters tab. See this part of the code of the function mentioned above:

...

switch ($customDAO->data_type) {

...

case 'String':

case 'StateProvince':

case 'Country':

      $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) {

        $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;

...

}

...

I tried to put some changes in order to handle String data type in this way:

...

switch ($customDAO->data_type) {

...

case 'String':

        // I-Mod Giovanni Dal Mas 17102018: add new code lines for case 'String'
        $curFilters[$fieldName]['type'] = CRM_Utils_Type::T_STRING;

        $curFilters[$fieldName]['operatorType'] = CRM_Report_Form::OP_STRING;

        break;

        // E-Mod Giovanni Dal Mas 17102018

case 'StateProvince':

case 'Country':

...

}

...

With these changes, I can see the String data type field in Filters tab

Best Regards

Giovanni

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.