CRM-16568 - Repeating Events: excluding dates doesn't stop the event from being created
authorjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Thu, 28 May 2015 11:45:20 +0000 (17:15 +0530)
committerjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Thu, 28 May 2015 11:45:20 +0000 (17:15 +0530)
CRM/Event/Form/ManageEvent/Repeat.php

index 02c79fbcdfef180ae7ec9c0be70f52d82cf8ed45..f031f006e0be0d9e491ebec9a541a0fcce2d2874 100644 (file)
@@ -102,6 +102,10 @@ class CRM_Event_Form_ManageEvent_Repeat extends CRM_Event_Form_ManageEvent {
       $params['excludeDateRangeColumns'] = array('start_date', 'end_date');
       $params['entity_table'] = 'civicrm_event';
       $params['entity_id'] = $this->_id;
+
+      // CRM-16568 - check if parent exist for the event.
+      $parentId = CRM_Core_BAO_RecurringEntity::getParentFor($this->_id, 'civicrm_event');
+      $params['parent_entity_id'] = !empty($parentId) ? $parentId : $params['entity_id'];
       //Unset event id
       unset($params['id']);