Summary: | Checkins should not require item to have been checked out | ||
---|---|---|---|
Product: | Koha | Reporter: | Andrew Fuerste-Henry <andrew> |
Component: | Circulation | Assignee: | Jonathan Druart <jonathan.druart> |
Status: | CLOSED FIXED | QA Contact: | Tomás Cohen Arazi (tcohen) <tomascohen> |
Severity: | critical | ||
Priority: | P5 - low | CC: | gmcharlt, jonathan.druart, kyle.m.hall, lucas, tomascohen |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
20.11.00
|
|
Circulation function: | |||
Bug Depends on: | 25855 | ||
Bug Blocks: | |||
Attachments: |
Bug 26108: (bug 25855 follow-up) Call after_circ_action hook only if issue exists
Bug 26108: Regression tests Bug 26108: Only call the plugin hook if a return took place |
Description
Andrew Fuerste-Henry
2020-07-30 19:02:40 UTC
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 |