more cleanup CRM-14937
authorkurund <kurund@civicrm.org>
Tue, 15 Jul 2014 19:11:57 +0000 (00:41 +0530)
committerkurund <kurund@civicrm.org>
Tue, 15 Jul 2014 19:11:57 +0000 (00:41 +0530)
----------------------------------------
* 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
CRM/Event/Form/ManageEvent/Location.php

index 6473a0ad34b5dc0df54f62fed4b6d25dcd150276..a4702ebeb298b3812de048ab5b3f481241d41a5c 100644 (file)
@@ -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;
index 6dcafef241951c8f941a4b0745c9dbfe38539421..61d72a86cf7881b4d3868cb7bcd42477bc30519f 100644 (file)
@@ -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);
   }
 
   /**