diff options
author | Bharat Mediratta <bharat@menalto.com> | 2009-02-15 00:58:14 +0000 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2009-02-15 00:58:14 +0000 |
commit | 5757fdbda8c1b0c8f2aadf397e9b09592a74b239 (patch) | |
tree | 2f658fbf1a02fc0f6f4e69bab8598566092ff60d /core/controllers/quick.php | |
parent | d8049cf711ffe9b6b7f531ea77dac23b86066516 (diff) |
If we're deleting an album cover, null it out in the parent.
Diffstat (limited to 'core/controllers/quick.php')
-rw-r--r-- | core/controllers/quick.php | 6 |
1 files changed, 6 insertions, 0 deletions
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 <b>%title</b>", 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); |