logs a NOTICE if multiple base events are found
authorPhilipp Schüle <p.schuele@metaways.de>
Fri, 11 Jul 2014 08:37:51 +0000 (10:37 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Tue, 15 Jul 2014 08:53:02 +0000 (10:53 +0200)
Change-Id: I675670ddc10318a2ce8d2976ae2d288e51fbee92
Reviewed-on: http://gerrit.tine20.com/customers/849
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Calendar/Controller/Event.php

index 0af3b49..758e3f6 100644 (file)
@@ -1131,10 +1131,16 @@ class Calendar_Controller_Event extends Tinebase_Controller_Record_Abstract impl
      */
     public function getRecurBaseEvent($_event)
     {
-        $baseEventId = array_value(0, $this->_backend->search(new Calendar_Model_EventFilter(array(
+        $possibleBaseEventIds = $this->_backend->search(new Calendar_Model_EventFilter(array(
             array('field' => 'uid',     'operator' => 'equals', 'value' => $_event->uid),
             array('field' => 'recurid', 'operator' => 'isnull', 'value' => NULL)
-        )), NULL, TRUE));
+        )), NULL, TRUE);
+        
+        if (count($possibleBaseEventIds) > 0) {
+            if (Tinebase_Core::isLogLevel(Zend_Log::NOTICE)) Tinebase_Core::getLogger()->notice(__METHOD__ . '::' . __LINE__ .
+                ' Got multiple possible base events: ' . print_r($possibleBaseEventIds, true));
+        }
+        $baseEventId = array_value(0, $possibleBaseEventIds);
         
         if (! $baseEventId) {
             throw new Tinebase_Exception_NotFound('base event of a recurring series not found');