Bug 26819: Fix calls to AuthorisedValues.GetDescriptionByKohaField in course-details.tt
authorKyle M Hall <kyle@bywatersolutions.com>
Mon, 2 Nov 2020 15:34:35 +0000 (10:34 -0500)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 25 Nov 2020 13:38:11 +0000 (14:38 +0100)
Test Plan:
1) In the staff interface go to course reserves.
2) Add a new course.
3) Add a reserve (Add reserves > add a valid barcode > submit).
4) Go to the list of courses and select the course you added the item to.
5) An error trace log is generated
6) Apply this patch
7) Reload the page
8) No errors!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt

index 32b33b6..d6c66c6 100644 (file)
                                      [% IF cr.course_item.enabled == 'yes' %]
                                      <strong>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorized_value => cr.item.ccode ) | html %]</strong>
                                         [% 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 %]
-                                            (<strong>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', cr.item.ccode ) | html %]</strong>)
+                                            (<strong>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorized_value => cr.item.ccode ) | html %]</strong>)
                                         [% END %]
                                      [% END %]
                                  [% ELSE %]
                                      <em>Unchanged</em>
                                      [% 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 %]
                             </td>