From 4811d396280feec904419905ccdf8ed168d98f25 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Sat, 15 Jul 2023 12:20:11 +1200 Subject: [PATCH] Treat subType as a internal varible, not a form property --- CRM/Custom/Form/CustomData.php | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/CRM/Custom/Form/CustomData.php b/CRM/Custom/Form/CustomData.php index 0d2812be20..a9f78a80cb 100644 --- a/CRM/Custom/Form/CustomData.php +++ b/CRM/Custom/Form/CustomData.php @@ -87,15 +87,12 @@ class CRM_Custom_Form_CustomData { $form->_type = CRM_Utils_Request::retrieve('type', 'String', $form); } - if (isset($subType)) { - $form->_subType = $subType; - } - else { - $form->_subType = CRM_Utils_Request::retrieve('subType', 'String', $form); + if (!isset($subType)) { + $subType = CRM_Utils_Request::retrieve('subType', 'String', $form); } - if ($form->_subType == 'null') { - $form->_subType = NULL; + if ($subType === 'null') { + $subType = NULL; } if (isset($subName)) { @@ -141,8 +138,6 @@ class CRM_Custom_Form_CustomData { $gid = (isset($form->_groupID)) ? $form->_groupID : NULL; $getCachedTree = $form->_getCachedTree ?? TRUE; - - $subType = $form->_subType; if (!is_array($subType) && strstr(($subType ?? ''), CRM_Core_DAO::VALUE_SEPARATOR)) { $subType = str_replace(CRM_Core_DAO::VALUE_SEPARATOR, ',', trim($subType, CRM_Core_DAO::VALUE_SEPARATOR)); } -- 2.25.1