Bug 26114 - ILL should mark status=RET only if a return happened
Summary: ILL should mark status=RET only if a return happened
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: ILL (show other bugs)
Version: Main
Hardware: All All
: P5 - low major
Assignee: Tomás Cohen Arazi (tcohen)
QA Contact: Martin Renvoize (ashimema)
URL:
Keywords:
Depends on: 23112
Blocks:
  Show dependency treegraph
 
Reported: 2020-07-31 13:13 UTC by Tomás Cohen Arazi (tcohen)
Modified: 2022-11-11 10:35 UTC (History)
3 users (show)

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


Attachments
Bug 26114: Regression tests (2.71 KB, patch)
2020-07-31 14:18 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 26114: ILL should mark status=RET only if a return happened (1.28 KB, patch)
2020-07-31 14:18 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 26114: ILL should mark status=RET only if a return happened (1.34 KB, patch)
2020-08-12 16:28 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 26114: Regression tests (2.77 KB, patch)
2020-08-12 16:28 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 26114: ILL should mark status=RET only if a return happened (1.34 KB, patch)
2020-08-12 16:28 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Tomás Cohen Arazi (tcohen) 2020-07-31 13:13:07 UTC
When the C4::Circulation::AddReturn reaches the ILL request update, there are many circumstances under which no return happened, and the ILL code doesn't check that.
Comment 1 Tomás Cohen Arazi (tcohen) 2020-07-31 14:18:31 UTC
Created attachment 107644 [details] [review]
Bug 26114: Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 2 Tomás Cohen Arazi (tcohen) 2020-07-31 14:18:35 UTC
Created attachment 107645 [details] [review]
Bug 26114: ILL should mark status=RET only if a return happened

The original code assumed every codepath should be trated as a
successful check-in. Such is not the case and the regression tests
verify that the code acknowledges this.

To test:
1. Apply the regression tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Illrequests.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>
Comment 3 Martin Renvoize (ashimema) 2020-08-12 16:28:00 UTC
Created attachment 108144 [details] [review]
Bug 26114: ILL should mark status=RET only if a return happened

The original code assumed every codepath should be trated as a
successful check-in. Such is not the case and the regression tests
verify that the code acknowledges this.

To test:
1. Apply the regression tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Illrequests.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>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 4 Martin Renvoize (ashimema) 2020-08-12 16:28:46 UTC
Created attachment 108145 [details] [review]
Bug 26114: Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 5 Martin Renvoize (ashimema) 2020-08-12 16:28:49 UTC
Created attachment 108146 [details] [review]
Bug 26114: ILL should mark status=RET only if a return happened

The original code assumed every codepath should be trated as a
successful check-in. Such is not the case and the regression tests
verify that the code acknowledges this.

To test:
1. Apply the regression tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Illrequests.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>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 6 Martin Renvoize (ashimema) 2020-08-12 16:29:16 UTC
Good catch, works as expected.

Signing off.
Comment 7 Martin Renvoize (ashimema) 2020-08-12 16:29:38 UTC
Going for QA on this.. it's well tested and passes QA scripts.. trivial change.

Passing QA
Comment 8 Jonathan Druart 2020-08-13 08:19:30 UTC
Pushed to master for 20.11, thanks to everybody involved!
Comment 9 Lucas Gass (lukeg) 2020-08-17 15:38:08 UTC
backported to 20.05.x for 20.05.03
Comment 10 Aleisha Amohia 2020-08-18 02:22:51 UTC
missing dependencies, not backported to 19.11.x