From a5b42daf665e71dd3fa3031538dd6bbd9e2965f0 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Mon, 16 Nov 2020 15:25:47 -0500 Subject: [PATCH] Bug 27038: Fix parameters for AuthorisedValues.GetDescriptionByKohaField Calls to GetDescriptionByKohaField are a bit mangled in course-details.tt and throw an error like: Template process failed: undef error - Can't use string ("NFIC") as a HASH ref while "strict refs" in use at /kohadevbox/koha/Koha/Template/Plugin/AuthorisedValues.pm line 83. at /kohadevbox/koha/C4/Templates.pm line 122 Test Plan: 1) Check out master 2) Create a course 3) Add an item to the course 4) View the course 5) Note the error 6) Apply this patch 7) Reload the page 8) No error! --- .../prog/en/modules/course_reserves/course-details.tt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt index 32b33b6ba4..d6c66c6e64 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt @@ -127,18 +127,18 @@ [% IF cr.course_item.enabled == 'yes' %] [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorized_value => cr.item.ccode ) | html %] [% IF cr.item.ccode %] - ([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', cr.course_item.ccode_storage ) | html %]) + ([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorized_value => cr.course_item.ccode_storage ) | html %]) [% END %] [% ELSE %] - [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', cr.course_item.ccode ) | html %] + [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorized_value => cr.course_item.ccode ) | html %] [% IF cr.item.ccode %] - ([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', cr.item.ccode ) | html %]) + ([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorized_value => cr.item.ccode ) | html %]) [% END %] [% END %] [% ELSE %] Unchanged [% IF cr.item.ccode %] - ([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', cr.item.ccode ) | html %]) + ([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorized_value => cr.item.ccode ) | html %]) [% END %] [% END %] -- 2.24.1 (Apple Git-126)