From dd7777c8b9dfede54c93b4d20b7abcae8627e9a2 Mon Sep 17 00:00:00 2001 From: Olivia Reynolds Date: Tue, 18 Aug 2026 15:02:27 +0000 Subject: [PATCH] Bug 43313: Fix catalogue detail shelving location display During the tidying up of Bug 41566, av_loc was accidentally changed to map descriptions to codes, rather than vice-versa. This broke the formatting of item permanent locations. Test plan (for KTD): 1. Navigate to an catalogue detail page, for example http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=262 2. Run the following SQL, replacing 262 with the biblionumber of your chosen page: UPDATE items SET location='CHILD' SET permanent_location='GEN' WHERE biblionumber=262; 3. Refresh the page and verify the items' shelving locations display "(Children's area)" only. 4. Apply patch and force refresh. 5. Verify the shelving location now correctly displays "General stacks" and "(Children's area)" on separate lines. Sponsored-by: Open Fifth Signed-off-by: John Vinke Signed-off-by: Andrew Fuerste Henry Signed-off-by: Pedro Amorim --- .../includes/html_helpers/tables/items/catalogue_detail.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 b4ca2bbcb1..f87ae3b255 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 @@ -111,7 +111,7 @@ const can_edit_items_from = [% To.json(can_edit_items_from || []) | $raw %]; const item_type_image_locations = [% To.json(item_type_image_locations) | $raw %]; - const av_loc = new Map([% To.json(AuthorisedValues.GetDescriptionsByKohaField({ kohafield => 'items.location' })) | $raw %].map( av => [av.lib, av.authorised_value])); + const av_loc = new Map([% To.json(AuthorisedValues.GetDescriptionsByKohaField({ kohafield => 'items.location' })) | $raw %].map( av => [av.authorised_value, av.lib])); const av_lost = new Map([% To.json(AuthorisedValues.GetDescriptionsByKohaField({ kohafield => 'items.itemlost' })) | $raw %].map( av => [av.authorised_value, av.lib])); const av_withdrawn = new Map([% To.json(AuthorisedValues.GetDescriptionsByKohaField({ kohafield => 'items.withdrawn' })) | $raw %].map( av => [av.authorised_value, av.lib])); const av_damaged = new Map([% To.json(AuthorisedValues.GetDescriptionsByKohaField({ kohafield => 'items.damaged' })) | $raw %].map( av => [av.authorised_value, av.lib])); @@ -505,7 +505,7 @@ 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)); + nodes += "%s
(%s)".format(escape_str(permanent_loc_str), escape_str(loc_str)); } else { nodes += escape_str(loc_str); }