Bug 29969: Prevent crash if 'Update holds' clicked after bulk cancellation
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 28 Jan 2022 14:04:49 +0000 (15:04 +0100)
committerFridolin Somers <fridolin.somers@biblibre.com>
Tue, 22 Feb 2022 01:15:47 +0000 (15:15 -1000)
commit450b629ed3554d893830414be8d2c6c9a96ea69f
tree71e6f0788be6ad283378263ab9c9b747799871d0
parent5433de09c8b5b51a96d1b364c31a16d66f062b76
Bug 29969: Prevent crash if 'Update holds' clicked after bulk cancellation

If you cancel holds in bulk, the list is not updated as we enqueued the
task. But the "Update hold(s)" button will explode if clicked.

Test plan:
Place several holds on a bib record
Use the "Cancel selected" link to cancel holds in bulk
The job is enqueued and the hold list still show the holds you cancelled
Click "Update holds"
=> Without this patch you get an ugly 500
Can't call method "found" on an undefined value at /kohadevbox/koha/C4/Reserves.pm line 1060
=> With this patch applied the table is refresh, no crash (and there is
a warning in the log, that may not be necessary)

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
C4/Reserves.pm
reserve/modrequest.pl
t/db_dependent/Holds.t