From c3dc86286c29661357fb696ec6759b93df4bcc89 Mon Sep 17 00:00:00 2001 From: Janusz Kaczmarek Date: Fri, 4 Oct 2024 19:07:12 +0000 Subject: [PATCH] Bug 38100: Items with damaged status are shown in OPAC results as "Not available" even with AllowHoldsOnDamagedItems Items with damaged status are shown on the OPAC results page as "Not available" even with AllowHoldsOnDamagedItems set to 'Allow', which is misleading for the users. 'other/Damaged' status should be assigned only if AllowHoldsOnDamagedItems is set to 'Don't allow'. Test plan: ========== 1. Check that AllowHoldsOnDamagedItems system preference is set to 'Allow'. 2. In librarian interface, change the damaged status of an item by setting it to 'Damaged'. 3. In OPAC, make a search for the record with this item attached. Use common words from title to get a list and not a single record. 4. Note that the item in question is labelled as 'Not available' (Damaged). 5. Apply the patch; restart_all. 6. Repeat p. 3. Note that the item is now labelled as 'available for loan'. 7. Set AllowHoldsOnDamagedItems system preference is set to 'Don't allow'. 8. Repeat p. 3. Note that the item is now labelled as 'Not available'. Signed-off-by: Roman Dolny Signed-off-by: Paul Derscheid Signed-off-by: Katrin Fischer --- C4/XSLT.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C4/XSLT.pm b/C4/XSLT.pm index 458d732d23..93ae47ec85 100644 --- a/C4/XSLT.pm +++ b/C4/XSLT.pm @@ -320,7 +320,7 @@ sub buildKohaItemsNamespace { $status = 'other'; $substatus = 'In transit'; } - elsif ($item->damaged) { + elsif ($item->damaged && ! C4::Context->preference('AllowHoldsOnDamagedItems')) { $status = 'other'; $substatus = "Damaged"; } -- 2.39.5