From 30b28ea350c3a56841e38e4178c1ee8c0ade79c7 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Tue, 14 Jul 2026 11:44:13 +0100 Subject: [PATCH] Bug 42915: (QA follow-up) Restore fallback message for holds with no patron data The "Add patron names to data in column def in holds table" patch dropped the null-patron handling in the patron column's render function, so a hold row whose patron embed comes back null (e.g. a user without permission to view the patron on that hold, per Bug 23269's test plan) now renders a blank cell instead of a useful message. Restore the fallback, sourced from `all_libraries` (populated by this same table's include) rather than the separate `libraries` global, and check `row.patron` directly instead of the now-composite `data` column key. To test: 1. Have holds on a bib from patrons the logged in user cannot see (e.g. IndependentBranches, or a reduced permission set) 2. View the record's Holds tab 3. Confirm rows with no visible patron show "A patron from library " instead of a blank Patron cell Signed-off-by: Martin Renvoize Signed-off-by: Lucas Gass --- koha-tmpl/intranet-tmpl/prog/js/holds.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/koha-tmpl/intranet-tmpl/prog/js/holds.js b/koha-tmpl/intranet-tmpl/prog/js/holds.js index fb3db5e759..730b26569d 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/holds.js +++ b/koha-tmpl/intranet-tmpl/prog/js/holds.js @@ -1547,6 +1547,14 @@ async function load_patron_holds_table(biblio_id, split_data) { orderable: true, searchable: true, render: function (data, type, row, meta) { + if (row.patron == null) { + let library = all_libraries.find( + library => library._id == row.pickup_library_id + ); + return __("A patron from library %s").format( + library ? library._str : row.pickup_library_id + ); + } return $patron_to_html(row.patron, { url: true, display_cardnumber: true,