dev/core#553: Creating new event takes value from default value not from saved templa...
authorMonish Deb <deb.monish@gmail.com>
Tue, 16 Apr 2019 11:36:55 +0000 (17:06 +0530)
committerMonish Deb <deb.monish@gmail.com>
Tue, 16 Apr 2019 11:36:55 +0000 (17:06 +0530)
CRM/Event/Form/ManageEvent/EventInfo.php

index 31317c09aa8d0fff18bea5c9a54815b1f1b79ca2..2176bab216d7f9b2df035012a7f9fa77f13bcb78 100644 (file)
@@ -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');