From 819386e0daab364ba118bdbda56e3e965ffd8df8 Mon Sep 17 00:00:00 2001
From: David Cook <dcook@prosentient.com.au>
Date: Wed, 6 Sep 2023 06:28:45 +0000
Subject: [PATCH] Bug 34723: Show thumbnails on opac-imageviewer.pl when
 imagenumber not provided

This patch fixes a method call in the opac-imageviewer.pl so that thumbnails
correctly appear.

Test plan:
0. Apply the patch
1. Go to
http://localhost:8081/cgi-bin/koha/admin/preferences.pl?tab=&op=search&searchfield=localcover
2. Change both *LocalCoverImages sysprefs to "Show"
3. Go to
http://localhost:8081/cgi-bin/koha/admin/preferences.pl?tab=&op=search&searchfield=AllowMultipleCovers
4. Change "AllowMultipleCovers" to "Allow"
5. Go to
http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=29
6. Click "Images (0)" tab
7. Download or make two JPEG images
8. Upload the images
9. Go to http://localhost:8080/cgi-bin/koha/opac-imageviewer.pl?biblionumber=29
10. See one large image in the centre and two smaller thumbnails on the right side

PA amended patch: Added missing test plan step

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
---
 koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-imageviewer.tt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-imageviewer.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-imageviewer.tt
index 597d88c360..788c25ad8a 100644
--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-imageviewer.tt
+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-imageviewer.tt
@@ -83,7 +83,7 @@
                         </div> <!-- / .span12 -->
 
                         [% IF OPACLocalCoverImages == 1 %]
-                            [% IF images.count %]
+                            [% IF images.size %]
                                 <div class="col-lg-3">
                                     <div id="thumbnails">
                                         [% FOREACH image IN images %]
-- 
2.30.2