From ff9d9fb3290855c100e5493482d3ba5b50b2d3f4 Mon Sep 17 00:00:00 2001 From: David Cook Date: Thu, 1 Dec 2022 09:52:55 +1100 Subject: [PATCH] Bug 32302: Hide "ISBN" label when no ISBN data when sending list Content-Type: text/plain; charset=utf-8 There is a logic mistake in the opac-sendshelf.tt template where we test if the "ISBN" key exists in the "BIBLIO_RESULT" hash when we should really be testing if the arrayref returned by "ISBN" is empty or not, since that "ISBN" key always exists and contains at least an empty arrayref. Test plan: 1. Apply patch and restart your Koha Starman 2. Create a public list containing records with 020 MARC fields and records without 020 MARC fields 3. View the list in the OPAC 4. Click "Send list" and email it to yourself 5. Note that only records with 020 MARC fields with show "ISBN:" in the email output Signed-off-by: David Nind Signed-off-by: Marcel de Rooy --- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-sendshelf.tt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-sendshelf.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-sendshelf.tt index 168dce74be..872e188694 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-sendshelf.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-sendshelf.tt @@ -58,7 +58,7 @@ Your list : [% shelfname | $raw %]
[% END %] - [% IF ( BIBLIO_RESULT.ISBN ) %] + [% IF ( BIBLIO_RESULT.ISBN.size > 0 ) %] ISBN: [% FOREACH isbn IN BIBLIO_RESULT.ISBN %] [% isbn | $raw %] -- 2.30.2