Need to ensure the correct calendar is currently opened before calling the parent...
authorMichael J. Rubinsky <mrubinsk@horde.org>
Fri, 25 Jun 2010 18:36:42 +0000 (14:36 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Fri, 25 Jun 2010 18:39:33 +0000 (14:39 -0400)
Due to the way Kronolith::getDriver() caches the driver, the driver's
currently opened calendar can change while still within this method.
Only took a day and half to track this down...

kronolith/lib/Driver/Resource.php

index b73d952..b9c8cc8 100644 (file)
@@ -35,11 +35,8 @@ class Kronolith_Driver_Resource extends Kronolith_Driver_Sql
      */
     public function deleteEvent($event, $silent = false)
     {
-        /* Since this is the Kronolith_Resource's version of the event, if we
-         * delete it, we must also make sure to remove it from the event that
-         * it is attached to. Not sure if there is a better way to do
-         * this... */
         $delete_event = $this->getEvent($event);
+
         $uid = $delete_event->uid;
         $driver = Kronolith::getDriver();
         $events = $driver->getByUID($uid, null, true);
@@ -52,7 +49,7 @@ class Kronolith_Driver_Resource extends Kronolith_Driver_Sql
                 $e->save();
             }
         }
-
+        $this->open($delete_event->calendar);
         parent::deleteEvent($event, $silent);
     }