From be84b2107b26e348aeac769547a7e3dff8aeadfe Mon Sep 17 00:00:00 2001 From: kurund Date: Wed, 16 Jul 2014 00:41:57 +0530 Subject: [PATCH] more cleanup CRM-14937 ---------------------------------------- * CRM-14937: CiviEvents: when using existing location on a new event, only the first phone number is loaded causing data loss on save https://issues.civicrm.org/jira/browse/CRM-14937 --- CRM/Event/Form/ManageEvent.php | 2 +- CRM/Event/Form/ManageEvent/Location.php | 12 +++--------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/CRM/Event/Form/ManageEvent.php b/CRM/Event/Form/ManageEvent.php index 6473a0ad34..a4702ebeb2 100644 --- a/CRM/Event/Form/ManageEvent.php +++ b/CRM/Event/Form/ManageEvent.php @@ -104,7 +104,7 @@ class CRM_Event_Form_ManageEvent extends CRM_Core_Form { $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this, FALSE, NULL, 'GET'); if ($this->_id) { $this->assign('eventId', $this->_id); - if (empty($this->_addProfileBottom) && empty($this->_addProfileBottomAdd)) { + if (!empty($this->_addBlockName) && empty($this->_addProfileBottom) && empty($this->_addProfileBottomAdd)) { $this->add('hidden', 'id', $this->_id); } $this->_single = TRUE; diff --git a/CRM/Event/Form/ManageEvent/Location.php b/CRM/Event/Form/ManageEvent/Location.php index 6dcafef241..61d72a86cf 100644 --- a/CRM/Event/Form/ManageEvent/Location.php +++ b/CRM/Event/Form/ManageEvent/Location.php @@ -75,19 +75,10 @@ class CRM_Event_Form_ManageEvent_Location extends CRM_Event_Form_ManageEvent { * @access public */ function preProcess() { - //location blocks. - CRM_Contact_Form_Location::preProcess($this); - - //skip rest of postpress when we are building additional email and phone blocks - if (!empty($this->_addBlockName)) { - return; - } - parent::preProcess(); $this->_values = $this->get('values'); if ($this->_id && empty($this->_values)) { - //get location values. $params = array( 'entity_id' => $this->_id, @@ -100,6 +91,9 @@ class CRM_Event_Form_ManageEvent_Location extends CRM_Event_Form_ManageEvent { CRM_Event_BAO_Event::retrieve($params, $this->_values); $this->set('values', $this->_values); } + + //location blocks. + CRM_Contact_Form_Location::preProcess($this); } /** -- 2.25.1