Bug 28761

Summary: Item status shows incorrectly on opac-course-details.pl
Product: Koha Reporter: Andrew Fuerste-Henry <andrewfh>
Component: OPACAssignee: Lucas Gass <lucas>
Status: Failed QA --- QA Contact: Marcel de Rooy <m.de.rooy>
Severity: normal    
Priority: P5 - low CC: kelly, lucas, m.de.rooy, martin.renvoize, nick
Version: master   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28762
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Fixes a problem in the OPAC course reserves table where restricted and not for loan statues were not displaying properly in the Status column.
Attachments: Bug 28762: Handle different item statuses in course details
Bug 28761: better handle notforloan and restricted status in item.status.inc
Bug 28761: better handle notforloan and restricted status in item.status.inc
Bug 28761: better handle notforloan and restricted status in item.status.inc

Description Andrew Fuerste-Henry 2021-07-26 19:56:37 UTC
To recreate:
- create a course in course reserves, add an item to it.
- confirm your item shows Available for its status on opac-course-details.pl
- give your item a notforloan status
- reload opac-course-details.pl, confirm its still "available"
- give your item a restricted user status
- reload opac-course-details.pl, confirm its still "available"
- give your item a lost, damaged, or withdrawn status
- reload opac-course-details.pl, these statuses *are* reflected

Filing a separate bug for the staff client.
Comment 1 Lucas Gass 2021-07-27 20:36:58 UTC Comment hidden (obsolete)
Comment 2 Lucas Gass 2021-07-27 21:37:26 UTC Comment hidden (obsolete)
Comment 3 Owen Leonard 2021-07-28 11:46:51 UTC Comment hidden (obsolete)
Comment 4 Nick Clemens 2021-07-30 11:30:08 UTC
This patch also affects the details page on the opac, and the cart

Before this patch a restricted item shows as:
Available (Restricted Access)

After it is:
Restricted Access
Comment 5 Lucas Gass 2021-07-31 13:40:54 UTC
Created attachment 123351 [details] [review]
Bug 28761: better handle notforloan and restricted status in item.status.inc

To test:
1. create a course in course reserves, add an item to it.
2. confirm your item shows Available for its status on
   opac-course-details.pl
3. give your item a notforloan status
4. reload opac-course-details.pl, confirm its still "available"
5. give your item a restricted user status
6. reload opac-course-details.pl, confirm its still "available"
7. give your item a lost, damaged, or withdrawn status
8. reload opac-course-details.pl, these statuses *are* reflected
9. apply patch
10. check notforloan and restricted, they should be reflect the correct status now
11. restricted status should NOT cause the item to become unavailable
11. The item-status.inc also effects opac-detail and opac-cart
12. look at those and make sure everything looks correct and statuses are properly reflected
Comment 6 Lucas Gass 2021-07-31 13:44:00 UTC
(In reply to Nick Clemens from comment #4)
> This patch also affects the details page on the opac, and the cart
> 
> Before this patch a restricted item shows as:
> Available (Restricted Access)
> 
> After it is:
> Restricted Access

Thanks Nick, I erroneously set the itemavailable flag to 0 for restricted items. They should be considered available. Reset the status of this one to NSO.
Comment 7 Kelly McElligott 2021-08-10 15:53:10 UTC
I have signed off on this : Kelly McElligott
kelly@bywatersolutions.com
Comment 8 Martin Renvoize 2021-09-27 09:56:20 UTC
I noticed this the other day.. should we also be falling back to item-type level not for loan values when the local not for loan is not set or set to allow loans.. which value should take precedence if both are set?

Otherwise, this looks pretty reasonable to me.
Comment 9 Katrin Fischer 2021-09-27 19:19:10 UTC
(In reply to Martin Renvoize from comment #8)
> I noticed this the other day.. should we also be falling back to item-type
> level not for loan values when the local not for loan is not set or set to
> allow loans.. which value should take precedence if both are set?
> 
> Otherwise, this looks pretty reasonable to me.

Not sure I understand the question correctly, do you mean item vs. record leven not for loan? Then I think if both are set, we should use the description from item level. To me it makes sense that the more specific should win.
Comment 10 Katrin Fischer 2021-10-24 13:06:26 UTC
There is a problem here with item type 'not for loan' set:

Without the patch:
- Mark an item type as not for loan in administration
- Make sure one item of that item type is on course reserve
- Check the detail page, it shows as: not for loan
- Check course reserves: it shows as: available

With the patch:
- It shows as Available on both detail and course reserves page

The correct behaviour would be to show "not for loan" on both, so this introduces a regression.

Lucas - when you follow-up, can you please add Kelly's sign-off line? So we don't forget about it.
Comment 11 Martin Renvoize 2024-01-27 19:23:42 UTC
Is this still on your list Lucas?