From bc84a837953f15d8525092b27d0b49c087d75980 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Fri, 1 Sep 2023 13:27:12 +1200 Subject: [PATCH] Use internal variable rather than undeclared property --- CRM/Contact/Form/CustomData.php | 4 ++-- CRM/Custom/Form/CustomData.php | 10 ++++------ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/CRM/Contact/Form/CustomData.php b/CRM/Contact/Form/CustomData.php index da7ab34fd8..9769ab9fa9 100644 --- a/CRM/Contact/Form/CustomData.php +++ b/CRM/Contact/Form/CustomData.php @@ -97,7 +97,7 @@ class CRM_Contact_Form_CustomData extends CRM_Core_Form { if (!empty($entityId)) { $subType = CRM_Contact_BAO_Contact::getContactSubType($entityId, ','); } - CRM_Custom_Form_CustomData::preProcess($this, NULL, $subType, NULL, NULL, $entityId); + CRM_Custom_Form_CustomData::preProcess($this, NULL, $subType, NULL, CRM_Utils_Request::retrieve('type', 'String', $this), $entityId); if ($this->_multiRecordDisplay) { $this->_groupID = CRM_Utils_Request::retrieve('groupID', 'Positive', $this); $this->_tableID = $this->_entityId; @@ -215,7 +215,7 @@ class CRM_Contact_Form_CustomData extends CRM_Core_Form { if ($this->_cdType || $this->_multiRecordDisplay == 'single') { if ($this->_copyValueId) { // cached tree is fetched - $groupTree = CRM_Core_BAO_CustomGroup::getTree($this->_type, + $groupTree = CRM_Core_BAO_CustomGroup::getTree('Contact', NULL, $this->_entityId, $this->_groupID, diff --git a/CRM/Custom/Form/CustomData.php b/CRM/Custom/Form/CustomData.php index 007d1caf3a..b063936c81 100644 --- a/CRM/Custom/Form/CustomData.php +++ b/CRM/Custom/Form/CustomData.php @@ -82,11 +82,9 @@ class CRM_Custom_Form_CustomData { &$form, $extendsEntityColumn = NULL, $subType = NULL, $groupCount = NULL, $type = NULL, $entityID = NULL, $onlySubType = NULL ) { - if ($type) { - $form->_type = $type; - } - else { - $form->_type = CRM_Utils_Request::retrieve('type', 'String', $form); + if (!$type) { + CRM_Core_Error::deprecatedWarning('type should be passed in'); + $type = CRM_Utils_Request::retrieve('type', 'String', $form); } if (!isset($subType)) { @@ -150,7 +148,7 @@ class CRM_Custom_Form_CustomData { $singleRecord = 'new'; } - $groupTree = CRM_Core_BAO_CustomGroup::getTree($form->_type, + $groupTree = CRM_Core_BAO_CustomGroup::getTree($type, NULL, $form->_entityId, $gid, -- 2.25.1