From a3eb12c9705eb2b6c01189a8ae96d40176dc4a21 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 27 Aug 2024 14:41:02 +0200 Subject: [PATCH] Bug 37544: Prevent the item table to crash if location is not linked with an av cat If location (952$c) is not linked with an authorisd value category, the item table won't load and will crash with "row._strings.location is undefined" in the JS console. Is it mandatory to have it linked? --- .../en/includes/html_helpers/tables/items/catalogue_detail.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc index 02b6edfa0e7..9af11948d81 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc @@ -369,7 +369,7 @@ [%# If permanent location is defined, show description or code and %] [%# display current location in parentheses. If not, display current location. %] [%# Note that permanent location is a code, and location may be an authval. %] - let loc_str = row._strings.location.str; + let loc_str = row._strings.location ? row._strings.location.str : row.location; if ( row.permanent_location && row.permanent_location != row.location ) { let permanent_loc_str = av_loc.get(row.permanent_location); nodes += '%s (%s)'.format(escape_str(permanent_loc_str), escape_str(loc_str)); -- 2.34.1