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>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Emmi Takkinen 2024-07-04 14:23:31 +03:00 committed by Tomas Cohen Arazi
parent 454314cb0e
commit e021150138
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F

View file

@ -884,14 +884,14 @@
[% IF ( waiting_hold_cancellation.defined && waiting_hold_cancellation != '' ) %] [% IF ( waiting_hold_cancellation.defined && waiting_hold_cancellation != '' ) %]
<tr> <tr>
<td> <td>
[% IF c == '*' %] [% IF c == undef %]
<em>All</em> <em>All</em>
[% ELSE %] [% ELSE %]
[% Categories.GetName(c) | html %] [% Categories.GetName(c) | html %]
[% END %] [% END %]
</td> </td>
<td> <td>
[% IF i == '*' %] [% IF i == undef %]
<em>All</em> <em>All</em>
[% ELSE %] [% ELSE %]
[% ItemTypes.GetDescription(i,1) | html %] [% ItemTypes.GetDescription(i,1) | html %]