From 2d86d9123452ca77c644c7a38755bb66dad872f0 Mon Sep 17 00:00:00 2001 From: Aidan Saunders Date: Tue, 10 Oct 2023 13:17:23 +0100 Subject: [PATCH] NFC: remove old pattern --- CRM/Event/Form/ManageEvent/EventInfo.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/CRM/Event/Form/ManageEvent/EventInfo.php b/CRM/Event/Form/ManageEvent/EventInfo.php index 0fd442b025..dd1009bca4 100644 --- a/CRM/Event/Form/ManageEvent/EventInfo.php +++ b/CRM/Event/Form/ManageEvent/EventInfo.php @@ -41,8 +41,8 @@ class CRM_Event_Form_ManageEvent_EventInfo extends CRM_Event_Form_ManageEvent { // when custom data is included in this page if (!empty($_POST['hidden_custom'])) { $this->set('type', 'Event'); - $this->set('subType', CRM_Utils_Array::value('event_type_id', $_POST)); - $this->assign('customDataSubType', CRM_Utils_Array::value('event_type_id', $_POST)); + $this->set('subType', $_POST['event_type_id'] ?? ''); + $this->assign('customDataSubType', $_POST['event_type_id'] ?? ''); $this->set('entityId', $entityID); CRM_Custom_Form_CustomData::preProcess($this, NULL, $this->_eventType, 1, 'Event', $entityID); @@ -88,12 +88,12 @@ class CRM_Event_Form_ManageEvent_EventInfo extends CRM_Event_Form_ManageEvent { $showHideBlocks->addToTemplate(); $this->assign('elemType', 'table-row'); - $this->assign('description', CRM_Utils_Array::value('description', $defaults)); + $this->assign('description', $defaults['description'] ?? ''); // Provide suggested text for event full and waitlist messages if they're empty - $defaults['event_full_text'] = CRM_Utils_Array::value('event_full_text', $defaults, ts('This event is currently full.')); + $defaults['event_full_text'] = $defaults['event_full_text'] ?? ts('This event is currently full.'); - $defaults['waitlist_text'] = CRM_Utils_Array::value('waitlist_text', $defaults, ts('This event is currently full. However you can register now and get added to a waiting list. You will be notified if spaces become available.')); + $defaults['waitlist_text'] = $defaults['waitlist_text'] ?? ts('This event is currently full. However you can register now and get added to a waiting list. You will be notified if spaces become available.'); $defaults['template_id'] = $this->_templateId; return $defaults; @@ -224,7 +224,6 @@ class CRM_Event_Form_ManageEvent_EventInfo extends CRM_Event_Form_ManageEvent { $params['is_share'] = $params['is_share'] ?? FALSE; $params['default_role_id'] = $params['default_role_id'] ?? FALSE; $params['id'] = $this->_id; - //merge params with defaults from templates if (!empty($params['template_id'])) { $params = array_merge(CRM_Event_BAO_Event::getTemplateDefaultValues($params['template_id']), $params); -- 2.25.1