From e746f98bc50c182296df72e19635edaadeff0b6d Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Fri, 25 Jun 2010 14:36:42 -0400 Subject: [PATCH] Need to ensure the correct calendar is currently opened before calling the parent method. 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 | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/kronolith/lib/Driver/Resource.php b/kronolith/lib/Driver/Resource.php index b73d952c0..b9c8cc8d1 100644 --- a/kronolith/lib/Driver/Resource.php +++ b/kronolith/lib/Driver/Resource.php @@ -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); } -- 2.11.0