From a11bf295078656612603c1c561e9261555d0c40c Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Sat, 9 Jan 2010 23:57:16 -0800 Subject: Fix for ticket #972 and more. In Kohana 2.4, ORM::delete_all ignores any where clauses and deletes all the entries in the table unless an array of id's are passed as the parameter. This fix used the Database_builder to specify any where conditions. Thanks psvo for find the first one. :-) --- modules/notification/helpers/notification_event.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'modules/notification/helpers') diff --git a/modules/notification/helpers/notification_event.php b/modules/notification/helpers/notification_event.php index 2c7ede27..bc1303f5 100644 --- a/modules/notification/helpers/notification_event.php +++ b/modules/notification/helpers/notification_event.php @@ -89,9 +89,10 @@ class notification_event_Core { static function user_before_delete($user) { try { - ORM::factory("subscription") + db::build() + ->delete("subscriptions") ->where("user_id", "=", $user->id) - ->delete_all(); + ->execute(); } catch (Exception $e) { Kohana_Log::add("error", "@todo notification_event::user_before_delete() failed"); Kohana_Log::add("error", $e->getMessage() . "\n" . $e->getTraceAsString()); -- cgit v1.2.3