From 310fe7c3d6ddc5d50bc5b2da165c5ebd13fb635e Mon Sep 17 00:00:00 2001 From: Aaron van Geffen Date: Sat, 11 Mar 2023 20:37:39 +0100 Subject: [PATCH] Hide thumbnail selection when none available --- controllers/EditAlbum.php | 3 ++- controllers/EditTag.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/controllers/EditAlbum.php b/controllers/EditAlbum.php index 76d549d0..c24787d5 100644 --- a/controllers/EditAlbum.php +++ b/controllers/EditAlbum.php @@ -132,7 +132,8 @@ class EditAlbum extends HTMLController 'id_tag' => $id_tag, ], true); - $this->page->adopt(new FeaturedThumbnailManager($assets, $id_tag ? $album->id_asset_thumb : 0)); + if ($num_assets > 0) + $this->page->adopt(new FeaturedThumbnailManager($assets, $id_tag ? $album->id_asset_thumb : 0)); } if (isset($_POST['changeThumbnail'])) diff --git a/controllers/EditTag.php b/controllers/EditTag.php index fcb0e966..c96ef0e8 100644 --- a/controllers/EditTag.php +++ b/controllers/EditTag.php @@ -123,7 +123,8 @@ class EditTag extends HTMLController 'id_tag' => $id_tag, ], true); - $this->page->adopt(new FeaturedThumbnailManager($assets, $id_tag ? $tag->id_asset_thumb : 0)); + if ($num_assets > 0) + $this->page->adopt(new FeaturedThumbnailManager($assets, $id_tag ? $tag->id_asset_thumb : 0)); } if (isset($_POST['changeThumbnail']))