From a74f1dabe23bdcc17b68c8053fcf868d62f9231e Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 21 Oct 2019 09:37:25 +0200 Subject: [PATCH] Bug 23847: Fix custom item search fields if subfield is '0' The subfield is not used if is false, so if 0. We want to test if the subfield is defined and not an empty string. Test plan: - Define a new custom item search fields using a subfield '0' (withdrawn=952$0 for instance) - Define one which does not have a subfield (control field) - Search items using those newly created fields. Signed-off-by: Katrin Fischer Signed-off-by: Marcel de Rooy Signed-off-by: Martin Renvoize --- koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt index 8c9a625dc3..ee1b43ea74 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt @@ -74,7 +74,7 @@ [% FOREACH field IN items_search_fields %] [% marcfield = field.tagfield %] - [% IF field.tagsubfield %] + [% IF field.tagsubfield.defined AND field.tagsubfield != "" %] [% marcfield = marcfield _ '$' _ field.tagsubfield %] [% END %] -- 2.39.5