If one creates a default waiting hold cancellation policy with patron categories set as "All" and itemtype set as "All", Koha breaks on 500 error. Logs read: Template process failed: undef error - Can't call method "description" on an undefined value at ../Koha/Koha/Template/Plugin/Categories.pm line 39.
Created attachment 168494 [details] [review] Bug 37255: Fix handling of "All" values on waiting hold cancellation policy If one creates a default waiting hold cancellation policy with patron categories set as "All" and itemtype set as "All", Koha breaks on 500 error. This happens because in we try to match template policy with "All" values either in category or itemtype with *, not undef. This patch fixes this. To test: 1. Create a new default waiting hold cancellation policy and set both patron category and itemtype as "All". 2. Save policy. => Error page for error 500 is displayed. 3. Apply this patch. 4. Reload page. => Page is displayed and policy listing displays new policy as it should. Sponsored-by: Koha-Suomi Oy
Created attachment 168524 [details] [review] Bug 37255: Fix handling of "All" values on waiting hold cancellation policy If one creates a default waiting hold cancellation policy with patron categories set as "All" and itemtype set as "All", Koha breaks on 500 error. This happens because in we try to match template policy with "All" values either in category or itemtype with *, not undef. This patch fixes this. To test: 1. Create a new default waiting hold cancellation policy and set both patron category and itemtype as "All". 2. Save policy. => Error page for error 500 is displayed. 3. Apply this patch. 4. Reload page. => Page is displayed and policy listing displays new policy as it should. Sponsored-by: Koha-Suomi Oy Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Created attachment 168552 [details] [review] Bug 37255: Fix handling of "All" values on waiting hold cancellation policy If one creates a default waiting hold cancellation policy with patron categories set as "All" and itemtype set as "All", Koha breaks on 500 error. This happens because in we try to match template policy with "All" values either in category or itemtype with *, not undef. This patch fixes this. To test: 1. Create a new default waiting hold cancellation policy and set both patron category and itemtype as "All". 2. Save policy. => Error page for error 500 is displayed. 3. Apply this patch. 4. Reload page. => Page is displayed and policy listing displays new policy as it should. Sponsored-by: Koha-Suomi Oy Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Same pattern causing bug 37263.
Pushed for 24.11! Well done everyone, thank you!
Increasing the severity on this one and flagging it for backport, since it crashes the page.
*** Bug 37531 has been marked as a duplicate of this bug. ***
Pushed to main for 24.11. Nice work everyone, thanks!
Pushed to 23.05.x. Nice work everyone, thanks!
(In reply to Tomás Cohen Arazi from comment #11) > Pushed to 23.05.x. > > Nice work everyone, thanks! Git bz error? Or did this actually get pushed for 23.05.x?
(In reply to Emily Lamancusa from comment #12) > (In reply to Tomás Cohen Arazi from comment #11) > > Pushed to 23.05.x. > > > > Nice work everyone, thanks! > > Git bz error? Or did this actually get pushed for 23.05.x? It will be part of the upcoming maintenance releases as an urgent backport. Stay tuned :)
(In reply to Katrin Fischer from comment #13) > (In reply to Emily Lamancusa from comment #12) > > (In reply to Tomás Cohen Arazi from comment #11) > > > Pushed to 23.05.x. > > > > > > Nice work everyone, thanks! > > > > Git bz error? Or did this actually get pushed for 23.05.x? > > It will be part of the upcoming maintenance releases as an urgent backport. > Stay tuned :) Ah, I see. It shouldn't be backported that far, though - the bug was caused by bug 36672, which is only in main and 24.05
Thanks for noticing Emily. I guess we can't leave it in? ...
Unfortunately, no. :( The cause of this regression was that a variable value was switched from '*' to undef, and a few cases got missed. So applying this patch to 23.05 causes the same 500 error that it's meant to solve in 24.05 and main.
It was more of a rhetoric question, I'll try to get that sorted ASAP.
Reverted the patch from 23.11, 23.05 and 22.11 branches. Thanks again Emily!
(In reply to Katrin Fischer from comment #18) > Reverted the patch from 23.11, 23.05 and 22.11 branches. > Thanks again Emily! I don't think this was reverted from 23.11.x, as it's still in 23.11.08.
(In reply to David Cook from comment #19) > (In reply to Katrin Fischer from comment #18) > > Reverted the patch from 23.11, 23.05 and 22.11 branches. > > Thanks again Emily! > > I don't think this was reverted from 23.11.x, as it's still in 23.11.08. You need to look at the latest tag: 23.11.08-1. That's what we used for the tarballs and packages. It has the revert on top: https://git.koha-community.org/Koha-community/Koha/commits/tag/v23.11.08-1
Depends on Bug 36672 not in 23.11.x
Not backporting to 23.05.x unless requested