Fold private setGroupTree function back into caller
authorEileen McNaughton <emcnaughton@wikimedia.org>
Sat, 15 Jul 2023 23:17:28 +0000 (11:17 +1200)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Sat, 15 Jul 2023 23:17:28 +0000 (11:17 +1200)
CRM/Custom/Form/CustomDataByType.php

index 74c94d9cd05b01d22646d6cac33eb253b3cc5c03..268534479a2734d90645f5f9ceca4e36718b87e2 100644 (file)
@@ -48,25 +48,6 @@ class CRM_Custom_Form_CustomDataByType extends CRM_Core_Form {
     if (array_key_exists($this->_type, $contactTypes)) {
       $this->assign('contactId', $this->_entityId);
     }
-    $this->setGroupTree($this, $subType, $groupID, $onlySubType);
-
-    $this->assign('suppressForm', TRUE);
-    $this->controller->_generateQFKey = FALSE;
-  }
-
-  /**
-   * Add the group data as a formatted array to the form.
-   *
-   * This was split off from a shared function.
-   *
-   * @param self $form
-   * @param string $subType
-   * @param int $gid
-   * @param bool $onlySubType
-   *
-   * @throws \CRM_Core_Exception
-   */
-  private function setGroupTree(&$form, $subType, $gid, $onlySubType = NULL) {
     $singleRecord = NULL;
     if (!empty($form->_groupCount) && !empty($form->_multiRecordDisplay) && $form->_multiRecordDisplay == 'single') {
       $singleRecord = $form->_groupCount;
@@ -81,7 +62,7 @@ class CRM_Custom_Form_CustomDataByType extends CRM_Core_Form {
     $groupTree = CRM_Core_BAO_CustomGroup::getTree($form->_type,
       NULL,
       $form->_entityId,
-      $gid,
+      $groupID,
       $subType,
       $form->_subName,
       TRUE,
@@ -106,6 +87,9 @@ class CRM_Custom_Form_CustomDataByType extends CRM_Core_Form {
     else {
       $form->_groupTree = $groupTree;
     }
+
+    $this->assign('suppressForm', TRUE);
+    $this->controller->_generateQFKey = FALSE;
   }
 
   /**