mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-07-10 01:09:19 -04:00
If we're deleting an album cover, null it out in the parent.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user