Koha is giving an internal server error when trying to check in an item that was not checked out. Possibly due to bug 26063?
It's coming from bug 25855 actually.
Created attachment 107618 [details] [review] Bug 26108: (bug 25855 follow-up) Call after_circ_action hook only if issue exists AddReturn can be called on an item even if it's not checked out (to trigger holds for instance). The hook should (?) not be called in that situation Test plan: Confirm the above and that the following tests are now passing: t/db_dependent/SIP/Message.t t/db_dependent/Reserves.t t/db_dependent/Circulation/issue.t t/db_dependent/SIP/Transaction.t t/db_dependent/Circulation.t
I have pushed this patch to fix master and not block people who would test other patches today. But a SO and QA is required to confirm it's the expected behaviour.
Created attachment 107640 [details] [review] Bug 26108: Regression tests The current implementation makes the assumption that if $issue is defined, then it is the 'return' use case. This is correct, but incomplete: after verifying that there's actually an issue, the return can be rejected for various reasons. This patch introduces a regression test for one of those situations (which I consider enough for testing purposes) . It highlights that the hook shouldn't be called if there hasn't been an actual checkin. To test: 1. Apply this patch 2. Run: $ kshell k$ prove t/db_dependent/Koha/Plugins/Circulation_hooks.t => FAIL: Tests fail because there's an unexpected warining printed by the erroneous plugin call (i.e. there's been no return but the plugin is called anyway). Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 107641 [details] [review] Bug 26108: Only call the plugin hook if a return took place This patch makes the hooks be called only if the checkin is effective (i.e. if it is not rejected for some reason. To test: 1. Apply the regression tests patch 2. Run: $ kshell k$ prove t/db_dependent/Koha/Plugins/Circulation_hooks.t => FAIL: Tests fail 3. Apply this patch 4. Repeat 2 => SUCCESS: Tests pass! 5. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Pushed to master for 20.11, thanks to everybody involved!
Missing dependency for 20.05.x, no backport