From 5757fdbda8c1b0c8f2aadf397e9b09592a74b239 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 15 Feb 2009 00:58:14 +0000 Subject: If we're deleting an album cover, null it out in the parent. --- core/controllers/quick.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'core/controllers') diff --git a/core/controllers/quick.php b/core/controllers/quick.php index 77a39bf5..96f05aab 100644 --- a/core/controllers/quick.php +++ b/core/controllers/quick.php @@ -106,6 +106,12 @@ class Quick_Controller extends Controller { $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(); + } + module::event("item_before_delete", $item); $item->delete(); message::success($msg); -- cgit v1.2.3