From 19750cb0d5499920bb7786aa4f890dec84fc5a1f Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 13 Sep 2010 22:00:59 -0700 Subject: 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. --- modules/gallery/helpers/gallery_event.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'modules') 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); } } -- cgit v1.2.3