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
   <library>" instead of a blank Patron cell

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Martin Renvoize 2026-07-14 11:44:13 +01:00 committed by Lucas Gass
parent b610f86595
commit 30b28ea350
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
1 changed files with 8 additions and 0 deletions

View File

@ -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,