Bug 37078

Summary: Damaged status not showing in record detail page
Product: Koha Reporter: Kelly McElligott <kelly>
Component: Staff interfaceAssignee: Phil Ringnalda <phil>
Status: Needs documenting --- QA Contact: Lucas Gass <lucas>
Severity: major    
Priority: P5 - low CC: andrewfh, blawlor, Chip.Halvorsen, cj.lynce, david, ddaghita, fridolin.somers, gmcharlt, holly, jonathan.druart, jzairo, kebliss, kyle.m.hall, lucas, phil
Version: MainKeywords: regression
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
This fixes the record details page to correctly show the damaged status for an item in the holdings table status column, instead of showing it as available.
Version(s) released in:
24.11.00,24.05.02
Circulation function:
Bug Depends on: 33568    
Bug Blocks:    
Attachments: Bug 37078: Damaged status not showing in detail.pl
Bug 37078: Damaged status not showing in detail.pl
Bug 37078: Damaged status not showing in detail.pl

Description Kelly McElligott 2024-06-12 14:25:36 UTC
Currently in 24.05 and in master, after setting an item to damaged, this status does not appear in the detail.pl page. The damaged status does show if the item is checked out, it will appear in the patron's checkouts with the damaged status. It also will show when the item is checked in.  If changing the item to LOST or Not for Loan, these values do show.  It appears to only not show when applying the item to the damaged status.
Comment 1 Kelly McElligott 2024-06-14 17:14:32 UTC
Oh, also the marking an item 'withdrawn' from the patron's account, the withdrawn status doesn't show the status in the patron's account but does show the withdrawn status from the bibliographic record page 
This is the opposite of the first comment on this bug.
Comment 2 Phil Ringnalda 2024-06-22 18:57:01 UTC
Comment 1 would be something else, this is just from bug 33568 using the wrong term to find damaged in the API output it uses to build the holdings table for bib detail.
Comment 3 Phil Ringnalda 2024-06-22 19:07:35 UTC
Created attachment 168003 [details] [review]
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')
Comment 4 Brendan Lawlor 2024-06-24 16:00:50 UTC
Created attachment 168021 [details] [review]
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>
Comment 5 Lucas Gass 2024-06-25 13:42:03 UTC
Simple solution to fairly bad problem, thanks Phil.
Comment 6 Lucas Gass 2024-06-25 13:42:28 UTC
Created attachment 168068 [details] [review]
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>
Comment 7 Katrin Fischer 2024-06-25 16:37:08 UTC
Pushed for 24.11!

Well done everyone, thank you!
Comment 8 CJ Lynce 2024-07-11 16:05:13 UTC
Can this be pushed to 24.05? 

Not showing the correct status is a significant issue for staff who use the holdings information regularly. Thx! --CJ
Comment 9 CJ Lynce 2024-07-11 16:06:17 UTC
rather, backported to 24.05 Thx! --CJ
Comment 10 Lucas Gass 2024-07-11 19:33:30 UTC
Backported to 24.05.x for upcoming 24.05.02
Comment 11 Lucas Gass 2024-07-16 17:48:38 UTC
*** Bug 37372 has been marked as a duplicate of this bug. ***
Comment 12 Fridolin Somers 2024-07-17 14:25:33 UTC
Depends on Bug 33568 not in 23.11.x