From 0e0ffe7b93e62bcc1920497f7cdfd8585dca2d22 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 2 Sep 2021 10:10:37 +0100 Subject: [PATCH] Bug 24857: (QA follow-up) Fix for missing Scalar context Template Toolkit will generally assume list context and so we get the wrong result when chaning relationships. We must force scalar context using the Scalar plugin. --- .../intranet-tmpl/prog/en/modules/catalogue/detail.tt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt index 0f7e6b628d..ba068aa2ce 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -1,5 +1,6 @@ [% USE raw %] [% USE Asset %] +[% USE Context %] [% USE Koha %] [% USE KohaDates %] [% USE KohaPlugins %] @@ -310,9 +311,12 @@ [% IF CAN_user_tools_items_batchmod %] Modify selected items [% END %] - [% IF CAN_user_editcatalogue_manage_item_groups && biblio.item_groups.count %] - Add/move to item group - Remove from item group + [% IF CAN_user_editcatalogue_manage_item_groups %] + [% SET item_groups_rs = Context.Scalar(biblio, 'item_groups') %] + [% IF item_groups_rs.count %] + Add/move to item group + Remove from item group + [% END %] [% END %] [% END %] -- 2.20.1