Fix notice on Constituent Summary report (strict smarty)
authorEileen McNaughton <emcnaughton@wikimedia.org>
Sun, 30 Apr 2023 23:14:01 +0000 (11:14 +1200)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Sun, 30 Apr 2023 23:14:01 +0000 (11:14 +1200)
CRM/Report/Form.php

index d7ead6275a863374c1abb940ad1e2f12da9d916a..e6c48be595947d226d2b9ba9f051d4f8982ffc58 100644 (file)
@@ -1319,13 +1319,13 @@ class CRM_Report_Form extends CRM_Core_Form {
                 }
               }
             }
+            // Having a group_title is secret code for being a custom group
+            // which cryptically translates to needing an accordion.
+            // here we make that explicit.
+            $colGroups[$tableName]['use_accordian_for_field_selection'] = !$groupTitle && isset($table['group_title']);
 
-            if (!$groupTitle && isset($table['group_title'])) {
-              $groupTitle = $table['group_title'];
-              // Having a group_title is secret code for being a custom group
-              // which cryptically translates to needing an accordion.
-              // here we make that explicit.
-              $colGroups[$tableName]['use_accordian_for_field_selection'] = TRUE;
+            if (!$groupTitle) {
+              $groupTitle = $table['group_title'] ?? NULL;
             }
 
             $colGroups[$tableName]['fields'][$fieldName] = $field['title'] ?? NULL;