From dc5f6e2b853db99d3682de0584df75c4c8d6501a Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Sun, 16 Jul 2023 11:29:51 +1200 Subject: [PATCH] Remove subName property in favour of an internal variable This is not used outside the function --- CRM/Custom/Form/CustomData.php | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/CRM/Custom/Form/CustomData.php b/CRM/Custom/Form/CustomData.php index 9d376275d0..007d1caf3a 100644 --- a/CRM/Custom/Form/CustomData.php +++ b/CRM/Custom/Form/CustomData.php @@ -67,7 +67,9 @@ class CRM_Custom_Form_CustomData { /** * @param CRM_Core_Form $form - * @param null|string $subName + * @param null|string $extendsEntityColumn + * Additional filter on the type of custom data to retrieve - e.g for + * participant data this could be a value representing role. * @param null|string $subType * @param null|int $groupCount * @param string $type @@ -77,7 +79,7 @@ class CRM_Custom_Form_CustomData { * @throws \CRM_Core_Exception */ public static function preProcess( - &$form, $subName = NULL, $subType = NULL, + &$form, $extendsEntityColumn = NULL, $subType = NULL, $groupCount = NULL, $type = NULL, $entityID = NULL, $onlySubType = NULL ) { if ($type) { @@ -90,20 +92,14 @@ class CRM_Custom_Form_CustomData { if (!isset($subType)) { $subType = CRM_Utils_Request::retrieve('subType', 'String', $form); } - if ($subType === 'null') { + // Is this reachable? $subType = NULL; } - - if (isset($subName)) { - $form->_subName = $subName; - } - else { - $form->_subName = CRM_Utils_Request::retrieve('subName', 'String', $form); - } - - if ($form->_subName == 'null') { - $form->_subName = NULL; + $extendsEntityColumn = $extendsEntityColumn ?: CRM_Utils_Request::retrieve('subName', 'String', $form); + if ($extendsEntityColumn === 'null') { + // Is this reachable? + $extendsEntityColumn = NULL; } if ($groupCount) { @@ -159,7 +155,7 @@ class CRM_Custom_Form_CustomData { $form->_entityId, $gid, $subType, - $form->_subName, + $extendsEntityColumn, $getCachedTree, $onlySubType, FALSE, -- 2.25.1