Pass value as variable, not property
authorEileen McNaughton <emcnaughton@wikimedia.org>
Mon, 18 Dec 2023 20:29:08 +0000 (09:29 +1300)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Mon, 18 Dec 2023 20:29:08 +0000 (09:29 +1300)
CRM/Contact/Form/Contact.php
CRM/Custom/Form/CustomData.php

index f37d5693a5d8237467e1b796822ede67fb58c3b2..169136292876a004c51145c43c11c3b4df77a84a 100644 (file)
@@ -322,7 +322,6 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form {
         $paramSubType = implode(',', $contactSubType);
       }
 
-      $this->_getCachedTree = FALSE;
       unset($customGroupCount[0]);
       foreach ($customGroupCount as $groupID => $groupCount) {
         if ($groupCount > 1) {
@@ -330,7 +329,7 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form {
           //loop the group
           for ($i = 1; $i <= $groupCount; $i++) {
             CRM_Custom_Form_CustomData::preProcess($this, NULL, $contactSubType,
-              $i, $this->_contactType, $this->_contactId
+              $i, $this->_contactType, $this->_contactId, NULL, FALSE
             );
             CRM_Contact_Form_Edit_CustomData::buildQuickForm($this);
           }
index d440ccad1c6f2f65f67c82a08a93249e2e0f35a7..94b9fb4189dfb4f49ddeb3d234e16a2a6b7b9c9d 100644 (file)
@@ -72,15 +72,16 @@ class CRM_Custom_Form_CustomData {
    *   participant data this could be a value representing role.
    * @param null|string $subType
    * @param null|int $groupCount
-   * @param string $type
+   * @param null $type
    * @param null|int $entityID
    * @param null $onlySubType
+   * @param bool $isLoadFromCache
    *
    * @throws \CRM_Core_Exception
    */
   public static function preProcess(
     &$form, $extendsEntityColumn = NULL, $subType = NULL,
-    $groupCount = NULL, $type = NULL, $entityID = NULL, $onlySubType = NULL
+    $groupCount = NULL, $type = NULL, $entityID = NULL, $onlySubType = NULL, $isLoadFromCache = TRUE
   ) {
     if (!$type) {
       CRM_Core_Error::deprecatedWarning('type should be passed in');
@@ -131,7 +132,6 @@ class CRM_Custom_Form_CustomData {
     }
 
     $gid = (isset($form->_groupID)) ? $form->_groupID : NULL;
-    $getCachedTree = $form->_getCachedTree ?? TRUE;
     if (!is_array($subType) && str_contains(($subType ?? ''), CRM_Core_DAO::VALUE_SEPARATOR)) {
       CRM_Core_Error::deprecatedWarning('Using a CRM_Core_DAO::VALUE_SEPARATOR separated subType deprecated, use a comma-separated string instead.');
       $subType = str_replace(CRM_Core_DAO::VALUE_SEPARATOR, ',', trim($subType, CRM_Core_DAO::VALUE_SEPARATOR));
@@ -154,7 +154,7 @@ class CRM_Custom_Form_CustomData {
       $gid,
       $subType,
       $extendsEntityColumn,
-      $getCachedTree,
+      $isLoadFromCache,
       $onlySubType,
       FALSE,
       CRM_Core_Permission::EDIT,