From 9938f61403dc6cd5abfd906eaf013bf7b53d9e5b Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 16 Jun 2022 12:33:31 +0200 Subject: [PATCH] Bug 30976: Display biblio's cover images first If one add cover images at item's level, then biblio level, the cover images of the items are displayed first on the main "cover slider" at the top of the page. We should displayed biblio cover images first, then the ones for the items. Signed-off-by: David Nind Signed-off-by: Martin Renvoize Signed-off-by: Tomas Cohen Arazi (cherry picked from commit 6c55159eb6a91891f7c1becd49ec927ee9a3a36a) Signed-off-by: Lucas Gass --- catalogue/detail.pl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/catalogue/detail.pl b/catalogue/detail.pl index 7586d80ab3..ae26f33740 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -556,7 +556,11 @@ if (C4::Context->preference("FRBRizeEditions")==1) { if ( C4::Context->preference("LocalCoverImages") == 1 ) { my $images = $biblio->cover_images; - $template->param( localimages => $biblio->cover_images ); + $template->param( + localimages => $biblio->cover_images->search( + {}, { order_by => [ \"COALESCE(itemnumber, 0, 1)", 'timestamp' ] } + ), + ); } # HTML5 Media -- 2.20.1