From 9a76f2eebc0387cca0a8b995e524d5c57ca96118 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Mon, 15 Nov 2021 07:26:57 +1300 Subject: [PATCH] Ensure paramSubType is always set --- CRM/Contact/Form/Contact.php | 3 +-- templates/CRM/Contact/Form/Contact.tpl | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/CRM/Contact/Form/Contact.php b/CRM/Contact/Form/Contact.php index 2fb8956e93..2bbb7a36ef 100644 --- a/CRM/Contact/Form/Contact.php +++ b/CRM/Contact/Form/Contact.php @@ -357,8 +357,6 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form { if ($this->_contactSubType || isset($paramSubType)) { $paramSubType = (isset($paramSubType)) ? $paramSubType : str_replace(CRM_Core_DAO::VALUE_SEPARATOR, ',', trim($this->_contactSubType, CRM_Core_DAO::VALUE_SEPARATOR)); - - $this->assign('paramSubType', $paramSubType); } if (CRM_Utils_Request::retrieve('type', 'String')) { @@ -377,6 +375,7 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form { $this->assign('customValueCount', $this->_customValueCount); } } + $this->assign('paramSubType', $paramSubType ?? ''); } /** diff --git a/templates/CRM/Contact/Form/Contact.tpl b/templates/CRM/Contact/Form/Contact.tpl index 336eb5190e..fe56d71bb9 100644 --- a/templates/CRM/Contact/Form/Contact.tpl +++ b/templates/CRM/Contact/Form/Contact.tpl @@ -185,7 +185,7 @@ subTypeValues = null; } else if (!subTypeValues) { - subTypeValues = {/literal}{if isset($paramSubType)}"{$paramSubType}"{else}""{/if}{literal}; + subTypeValues = {/literal}"{$paramSubType}"{literal}; } function loadNextRecord(i, groupValue, groupCount) { if (i < groupCount) { -- 2.25.1