From: Monish Deb Date: Tue, 16 Apr 2019 11:36:55 +0000 (+0530) Subject: dev/core#553: Creating new event takes value from default value not from saved templa... X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=83fd174a97194f6bc0d1c31ae8abc90131694950;p=civicrm-core.git dev/core#553: Creating new event takes value from default value not from saved template for custom fields --- diff --git a/CRM/Event/Form/ManageEvent/EventInfo.php b/CRM/Event/Form/ManageEvent/EventInfo.php index 31317c09aa..2176bab216 100644 --- a/CRM/Event/Form/ManageEvent/EventInfo.php +++ b/CRM/Event/Form/ManageEvent/EventInfo.php @@ -48,10 +48,11 @@ class CRM_Event_Form_ManageEvent_EventInfo extends CRM_Event_Form_ManageEvent { parent::preProcess(); $this->assign('selectedChild', 'settings'); - if ($this->_id) { - $this->assign('entityID', $this->_id); + $entityID = $this->_id ?: $this->_templateId; + if ($entityID) { + $this->assign('entityID', $entityID); $eventType = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Event', - $this->_id, + $entityID, 'event_type_id' ); } @@ -127,7 +128,6 @@ class CRM_Event_Form_ManageEvent_EventInfo extends CRM_Event_Form_ManageEvent { if ($this->_eventType) { $this->assign('customDataSubType', $this->_eventType); } - $this->assign('entityId', $this->_id); $this->_first = TRUE; $this->applyFilter('__ALL__', 'trim');