diff options
author | Bharat Mediratta <bharat@menalto.com> | 2010-09-13 22:00:59 -0700 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2010-09-13 22:02:19 -0700 |
commit | 19750cb0d5499920bb7786aa4f890dec84fc5a1f (patch) | |
tree | 885951b5c0897ead0e99c2c40610a2c00c4c974d /modules/gallery/helpers | |
parent | b08bf26d2db6c78315ef3ddfc2e0191923ecfa42 (diff) |
When deleting items, choose the first *viewable* peer as the album
cover. Normally, all items are equally viewable, but in our unit
tests we occasionally have the scenario where peers have different
viewability settings which is internally consistent although only
possible if you set the fields manually.
Diffstat (limited to 'modules/gallery/helpers')
-rw-r--r-- | modules/gallery/helpers/gallery_event.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/gallery/helpers/gallery_event.php b/modules/gallery/helpers/gallery_event.php index 5b1db987..78a9f5a9 100644 --- a/modules/gallery/helpers/gallery_event.php +++ b/modules/gallery/helpers/gallery_event.php @@ -118,8 +118,8 @@ class gallery_event_Core { $batch_missing_album_cover[$parent->id] = 1; Session::instance()->set("batch_missing_album_cover", $batch_missing_album_cover); } else { - // Choose the first child as the new cover. - if ($child = $parent->children(1)->current()) { + // Choose the first viewable child as the new cover. + if ($child = $parent->viewable()->children(1)->current()) { item::make_album_cover($child); } } |