Skip to content

Commit

Permalink
If the target of an item move has no album cover, make the newly move…
Browse files Browse the repository at this point in the history
…d item the album cover.

Fixes ticket #1196.
  • Loading branch information
bharat committed Jul 11, 2010
1 parent b20f912 commit eb19192
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions modules/gallery/helpers/gallery_event.php
Expand Up @@ -142,6 +142,11 @@ static function batch_complete() {

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) {
Expand Down

0 comments on commit eb19192

Please sign in to comment.