CRM-21538: Field not found when sorting report by Case Type as a section header
authorOcto Hapiness <email@example.com>
Sat, 16 Dec 2017 08:57:53 +0000 (09:57 +0100)
committerOcto Hapiness <email@example.com>
Sat, 16 Dec 2017 20:54:47 +0000 (21:54 +0100)
CRM/Report/Form/Case/Detail.php

index f78e3e3c5429e399d3d2b5a8aac7c1d22b1c2f73..205aa72af433b34011589c33c5aed1dd00aaf92c 100644 (file)
@@ -549,6 +549,9 @@ class CRM_Report_Form_Case_Detail extends CRM_Report_Form {
 
     if ($this->_caseTypeNameOrderBy) {
       $this->_orderBy = str_replace('case_civireport.case_type_name', 'civireport_case_types.title', $this->_orderBy);
+      if (isset($this->_sections['civicrm_case_case_type_name'])) {
+        $this->_sections['civicrm_case_case_type_name']['dbAlias'] = 'civireport_case_types.title';
+      }
     }
   }