If we're deleting an album cover, null it out in the parent.

This commit is contained in:
Bharat Mediratta
2009-02-15 00:58:14 +00:00
parent d8049cf711
commit 5757fdbda8

View File

@@ -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);