diff options
author | Bharat Mediratta <bharat@menalto.com> | 2010-07-10 18:51:57 -0700 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2010-07-10 18:51:57 -0700 |
commit | eb19192c4e7b9433c16b1acc14fa5c1242e27bc1 (patch) | |
tree | 5f64024f26e45050cdd861ceb81eb4105bb3bd28 /modules/gallery | |
parent | b20f9123dc0cc4bc70597910e12eb18ec0eef2c2 (diff) |
If the target of an item move has no album cover, make the newly moved item the album cover.
Fixes ticket #1196.
Diffstat (limited to 'modules/gallery')
-rw-r--r-- | modules/gallery/helpers/gallery_event.php | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/gallery/helpers/gallery_event.php b/modules/gallery/helpers/gallery_event.php index 60520690..76bd9ee7 100644 --- a/modules/gallery/helpers/gallery_event.php +++ b/modules/gallery/helpers/gallery_event.php @@ -142,6 +142,11 @@ class gallery_event_Core { static function item_moved($item, $old_parent) { access::recalculate_permissions($item->parent()); + + // If the new parent doesn't have an album cover, make this it. + if (!$item->parent()->album_cover_item_id) { + item::make_album_cover($item); + } } static function user_login($user) { |