Bug 37078: Damaged status not showing in detail.pl

The API returns the fact that an item is damaged in 'damaged_status' but the
code that builds the holdings table is looking for 'damaged' so it doesn't
find that an item is damaged.

Test plan:
1. Administration - Authorized values - DAMAGED row, click Add
2. Give it the Authorized value 2 and the Description Awful
3. On a record with more than one item, like Empress of the blues,
   edit one item to have Damaged status: Damaged and one to have
   Damaged status: Awful
4. On the bib detail view, note that the status column shows both
   as 'Available'
5. Apply patch, refresh
6. Note that now one shows as Damaged and one as Awful (verifying that
   the value is being read from the AV, not the fallback default which
   is also 'Damaged')

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 65e0ffa882)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Phil Ringnalda 2024-06-22 11:58:41 -07:00 committed by Lucas Gass
parent ad968a00d0
commit c4a481a65a
1 changed files with 3 additions and 3 deletions

View File

@ -488,8 +488,8 @@
nodes += '<span class="wdn">%s</span>'.format(escape_str(withdrawn_lib));
}
if ( row.damaged ) {
let damaged_lib = av_damaged.get(row.damaged.toString()) || _("Damaged");
if ( row.damaged_status ) {
let damaged_lib = av_damaged.get(row.damaged_status.toString()) || _("Damaged");
nodes += '<span class="dmg">%s</span>'.format(escape_str(damaged_lib));
}
@ -533,7 +533,7 @@
}
[% END %]
if ( ! ( row.not_for_loan_status || item_types_notforloan[row.item_type_id] || row.checked_out_date || row.lost_status || row.withdrawn || row.damaged || row.transfer || row.first_hold || row.recall ) ) {
if ( ! ( row.not_for_loan_status || item_types_notforloan[row.item_type_id] || row.checked_out_date || row.lost_status || row.withdrawn || row.damaged_status || row.transfer || row.first_hold || row.recall ) ) {
nodes += ' <span>%s</span>'.format(_("Available"))
}