From 0d49773559160120768d33b574f97d9b6b993a3d Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Wed, 29 Apr 2009 00:40:59 +0000 Subject: Reset the parent thumbnail in Item_Model::delete instead of where the delete was happening. This will insure that it is consistently done for all deletes and we don't have to remember to replicate the code. --- core/controllers/quick.php | 8 -------- 1 file changed, 8 deletions(-) (limited to 'core/controllers') diff --git a/core/controllers/quick.php b/core/controllers/quick.php index 32febb31..cb43a50f 100644 --- a/core/controllers/quick.php +++ b/core/controllers/quick.php @@ -106,20 +106,12 @@ class Quick_Controller extends Controller { $item = ORM::factory("item", $id); access::required("edit", $item); - $parent = $item->parent(); - if ($item->is_album()) { $msg = t("Deleted album %title", array("title" => $item->title)); } else { $msg = t("Deleted photo %title", array("title" => $item->title)); } - if ($parent->album_cover_item_id == $item->id) { - // @todo change the album cover to some other random image inside the album - $parent->album_cover_item_id = null; - $parent->save(); - } - $item->delete(); message::success($msg); -- cgit v1.2.3