Post unshare cleanup
authorEileen McNaughton <emcnaughton@wikimedia.org>
Sat, 15 Jul 2023 00:12:42 +0000 (12:12 +1200)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Sat, 15 Jul 2023 00:14:04 +0000 (12:14 +1200)
This stops passing & returning unused values from the previously shared function
& removes a deprecated chunk.

This deprecation was very precautionary IMHO so 6 months is long enough

CRM/Custom/Form/CustomDataByType.php

index b4cc13c266ce6171c9f2ca43b8e1f2cd47526ea9..25d4d635dc6ded5f418a87aa71a1e3db713a076d 100644 (file)
@@ -48,10 +48,6 @@ class CRM_Custom_Form_CustomDataByType extends CRM_Core_Form {
     if (array_key_exists($this->_type, $contactTypes)) {
       $this->assign('contactId', $this->_entityId);
     }
-    if (!is_array($this->_subType) && strstr($this->_subType ?? '', CRM_Core_DAO::VALUE_SEPARATOR)) {
-      CRM_Core_Error::deprecatedWarning('Using a CRM_Core_DAO::VALUE_SEPARATOR separated subType on civicrm/custom route is deprecated, use a comma-separated string instead.');
-      $this->_subType = str_replace(CRM_Core_DAO::VALUE_SEPARATOR, ',', trim($this->_subType, CRM_Core_DAO::VALUE_SEPARATOR));
-    }
     $this->setGroupTree($this, $this->_subType, $this->_groupID, $this->_onlySubtype);
 
     $this->assign('suppressForm', TRUE);
@@ -67,12 +63,10 @@ class CRM_Custom_Form_CustomDataByType extends CRM_Core_Form {
    * @param string $subType
    * @param int $gid
    * @param bool $onlySubType
-   * @param bool $getCachedTree
    *
-   * @return array
    * @throws \CRM_Core_Exception
    */
-  private function setGroupTree(&$form, $subType, $gid, $onlySubType = NULL, $getCachedTree = TRUE) {
+  private function setGroupTree(&$form, $subType, $gid, $onlySubType = NULL) {
     $singleRecord = NULL;
     if (!empty($form->_groupCount) && !empty($form->_multiRecordDisplay) && $form->_multiRecordDisplay == 'single') {
       $singleRecord = $form->_groupCount;
@@ -90,7 +84,7 @@ class CRM_Custom_Form_CustomDataByType extends CRM_Core_Form {
       $gid,
       $subType,
       $form->_subName,
-      $getCachedTree,
+      TRUE,
       $onlySubType,
       FALSE,
       CRM_Core_Permission::EDIT,
@@ -108,11 +102,9 @@ class CRM_Custom_Form_CustomDataByType extends CRM_Core_Form {
       foreach ($keys as $key) {
         $form->_groupTree[$key] = $groupTree[$key];
       }
-      return [$form, $groupTree];
     }
     else {
       $form->_groupTree = $groupTree;
-      return [$form, $groupTree];
     }
   }