Bug 29969 - Cannot update hold list after holds cancelled in bulk
Summary: Cannot update hold list after holds cancelled in bulk
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Hold requests (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low major
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on: 23678
Blocks:
  Show dependency treegraph
 
Reported: 2022-01-28 13:42 UTC by Jonathan Druart
Modified: 2022-12-12 21:24 UTC (History)
7 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
22.05.00
Circulation function:


Attachments
Bug 29969: Prevent crash if 'Update holds' clicked after bulk cancellation (3.37 KB, patch)
2022-01-28 14:08 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 29969: Prevent crash if 'Update holds' clicked after bulk cancellation (3.36 KB, patch)
2022-01-31 10:15 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 29969: Prevent crash if 'Update holds' clicked after bulk cancellation (3.41 KB, patch)
2022-01-31 16:17 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 30089: (bug 29844 follow-up) Fix placing holds - OPAC (1.32 KB, patch)
2022-02-18 15:38 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2022-01-28 13:42:56 UTC
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:

Can't call method "found" on an undefined value at /kohadevbox/koha/C4/Reserves.pm line 1060.                                                                                                                        
 at /kohadevbox/koha/C4/Reserves.pm line 1057                                                                                                                                                                        
        C4::Reserves::ModReserve('HASH(0x5583dff297d8)') called at /kohadevbox/koha/reserve/modrequest.pl line 87
Comment 1 Jonathan Druart 2022-01-28 14:08:36 UTC
Created attachment 129948 [details] [review]
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)
Comment 2 David Nind 2022-01-30 18:21:44 UTC
Patch no longer applies 8-(...

Apply? [(y)es, (n)o, (i)nteractive] y
Applying: Bug 29969: Prevent crash if 'Update holds' clicked after bulk cancellation
error: sha1 information is lacking or useless (C4/Reserves.pm).
error: could not build fake ancestor
Patch failed at 0001 Bug 29969: Prevent crash if 'Update holds' clicked after bulk cancellation
hint: Use 'git am --show-current-patch=diff' to see the failed patch
When you have resolved this problem run "git bz apply --continue".
If you would prefer to skip this patch, instead run "git bz apply --skip".
To restore the original branch and stop patching run "git bz apply --abort".
Comment 3 Jonathan Druart 2022-01-31 10:15:54 UTC
Created attachment 129990 [details] [review]
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)
Comment 4 Tomás Cohen Arazi (tcohen) 2022-01-31 16:17:19 UTC
Created attachment 130017 [details] [review]
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>
Comment 5 Nick Clemens (kidclamp) 2022-02-18 15:38:23 UTC
Created attachment 130865 [details] [review]
Bug 30089: (bug 29844 follow-up) Fix placing holds - OPAC

The method Koha::AuthorisedValues->authorised_value is not covered by tests!

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 6 Fridolin Somers 2022-02-22 00:44:40 UTC
(In reply to Nick Clemens from comment #5)
> Created attachment 130865 [details] [review] [review]
> Bug 30089: (bug 29844 follow-up) Fix placing holds - OPAC
> 
> The method Koha::AuthorisedValues->authorised_value is not covered by tests!
> 
> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
> 
> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Ich, wrong bug Nick :D
Comment 7 Fridolin Somers 2022-02-22 01:14:39 UTC
Pushed to master for 22.05, thanks to everybody involved ﷐[U+1F984]﷑
Comment 8 Andrew Fuerste-Henry 2022-03-07 21:05:24 UTC
Missing dependency, not backported to 21.05