From 06806a70da84c4556339052d11f5bcb14cc599c4 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Wed, 19 Jan 2022 14:50:26 +1300 Subject: [PATCH] Remove silly calls to contactSubTypes --- CRM/Core/Component.php | 10 +--------- CRM/Custom/Form/Group.php | 25 ++++++------------------- CRM/Custom/Page/Group.php | 9 +-------- 3 files changed, 8 insertions(+), 36 deletions(-) diff --git a/CRM/Core/Component.php b/CRM/Core/Component.php index d33157adb6..a8adba6db9 100644 --- a/CRM/Core/Component.php +++ b/CRM/Core/Component.php @@ -24,11 +24,6 @@ class CRM_Core_Component { */ const COMPONENT_INFO_CLASS = 'Info'; - /** - * @var array - */ - public static $_contactSubTypes; - /** * @param bool $force * @@ -357,10 +352,7 @@ class CRM_Core_Component { */ public static function contactSubTypes() { CRM_Core_Error::deprecatedWarning('unused'); - if (self::$_contactSubTypes == NULL) { - self::$_contactSubTypes = []; - } - return self::$_contactSubTypes; + return []; } /** diff --git a/CRM/Custom/Form/Group.php b/CRM/Custom/Form/Group.php index 0f907d9bbe..cf4c37cdac 100644 --- a/CRM/Custom/Form/Group.php +++ b/CRM/Custom/Form/Group.php @@ -187,26 +187,13 @@ class CRM_Custom_Form_Group extends CRM_Core_Form { } } - $cSubTypes = CRM_Core_Component::contactSubTypes(); + if (!isset($this->_id)) { + $formName = 'document.forms.' . $this->_name; - if (!empty($cSubTypes)) { - $contactSubTypes = []; - foreach ($cSubTypes as $key => $value) { - $contactSubTypes[$key] = $key; - } - $sel2['Contact'] = [ - "" => ("- Any -"), - ] + $contactSubTypes; - } - else { - if (!isset($this->_id)) { - $formName = 'document.forms.' . $this->_name; - - $js = ""; - $this->assign('initHideBlocks', $js); - } + $js = ""; + $this->assign('initHideBlocks', $js); } $sel = &$this->add('hierselect', diff --git a/CRM/Custom/Page/Group.php b/CRM/Custom/Page/Group.php index e462099b67..ec7b742ede 100644 --- a/CRM/Custom/Page/Group.php +++ b/CRM/Custom/Page/Group.php @@ -254,14 +254,7 @@ class CRM_Custom_Page_Group extends CRM_Core_Page { } $subTypes['Relationship'] = $allRelationshipType; - - $cSubTypes = CRM_Core_Component::contactSubTypes(); - $contactSubTypes = []; - foreach ($cSubTypes as $key => $value) { - $contactSubTypes[$key] = $key; - } - - $subTypes['Contact'] = $contactSubTypes; + $subTypes['Contact'] = []; CRM_Core_BAO_CustomGroup::getExtendedObjectTypes($subTypes); -- 2.25.1