Fix show_public regression
authorEileen McNaughton <emcnaughton@wikimedia.org>
Tue, 23 May 2023 07:59:27 +0000 (19:59 +1200)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Tue, 23 May 2023 07:59:27 +0000 (19:59 +1200)
This shows up as an e-notice but
would probably result in the is_public filter being broken.

The variable is no longer set since https://github.com/civicrm/civicrm-core/commit/16c5faa5db26149e5f1b7d3f45e3d5f2c24bf422#diff-d20bbdac5d9d1d3ec28be6f1972f8cb747ead74dea90c9076daa2de2a627873cL110

CRM/Core/BAO/CustomGroup.php

index 5e1272bea62136d795d830b96455b2232892cfaa..fedf435938507b0025826e4d3bafe2be787581d8 100644 (file)
@@ -527,16 +527,16 @@ WHERE civicrm_custom_group.is_active = 1
         );
     }
 
-    if ($showPublicOnly && $is_public_version) {
-      $strWhere .= "AND civicrm_custom_group.is_public = 1";
+    if ($showPublicOnly) {
+      $strWhere .= 'AND civicrm_custom_group.is_public = 1';
     }
 
-    $orderBy = "
+    $orderBy = '
 ORDER BY civicrm_custom_group.weight,
          civicrm_custom_group.title,
          civicrm_custom_field.weight,
          civicrm_custom_field.label
-";
+';
 
     // final query string
     $queryString = "$strSelect $strFrom $strWhere $orderBy";