To recreate: 1 - Manually add a lost fine to a ptron and include a barcode 2 - Attempt to write off the fine 3 - Internal server error 4 - Checkout an item and mark lost to checkin and fine 5 - Attempt to write off line 6 - Internal server error It appears we are trying to move a non-existent issue to old_issues
Created attachment 68275 [details] [review] Bug 19487: Do not return an item if not checked out To recreate: 1 - Manually add a lost fine to a ptron and include a barcode 2 - Attempt to write off the fine 3 - Internal server error 4 - Checkout an item and mark lost to checkin and fine 5 - Attempt to write off line 6 - Internal server error
Upping severity, it affects stable release (at least 17.05.x)
Created attachment 68293 [details] [review] Bug 19487: Do not return an item if not checked out To recreate: 1 - Manually add a lost fine to a ptron and include a barcode 2 - Attempt to write off the fine 3 - Internal server error 4 - Checkout an item and mark lost to checkin and fine 5 - Attempt to write off line 6 - Internal server error 7 - Apply patch 8 - Repeat without errors Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
perl t/db_dependent/Circulation/MarkIssueReturned.t 1..2 not ok 1 # Failed test at t/db_dependent/Circulation/MarkIssueReturned.t line 50. # '' # doesn't match '(?^u:Fatal error: the patron \(\d+\) .* AnonymousPatron)' ok 2 # Looks like you failed 1 test of 2.
Created attachment 68294 [details] [review] Bug 19487: Fix MarkIssueReturned.t MarkIssueReturned must now return directly if the issue does not exist. We then check if the anonymous patron configuration is correct.
QA: Looking here now
Created attachment 68312 [details] [review] Bug 19487: Fix MarkIssueReturned.t MarkIssueReturned must now return directly if the issue does not exist. We then check if the anonymous patron configuration is correct. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Created attachment 68313 [details] [review] Bug 19487: (QA follow-up) More changes to MarkIssueReturned.t $dbh is not used $categorycode is no longer used %item_branch_infos not used $borrowernumber is obsoleted by using $patron No real need for $anonymous_borrowernumber No AddMember calls, removing unneeded modules Adding a test that calls MarkIssueReturned on an item already returned. Test plan: [1] Without the patch changing MarkIssueReturned, this test fails (3 of 6). [2] With the patch, the test should pass. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Created attachment 68314 [details] [review] Bug 19487: Do not return an item if not checked out To recreate: 1 - Manually add a lost fine to a ptron and include a barcode 2 - Attempt to write off the fine 3 - Internal server error 4 - Checkout an item and mark lost to checkin and fine 5 - Attempt to write off line 6 - Internal server error Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment on attachment 68313 [details] [review] Bug 19487: (QA follow-up) More changes to MarkIssueReturned.t I am not willing to push this patch. We want a fix for stable releases, so something easy to backport. This change is quite big may slow down the backport. Moreover it seems that at least one test has been removed: -unlike ( $@, qr<Fatal error: the patron \(\d+\) .* AnonymousPatron>, ); and this line too, which makes me think you cut a bit too much: t::lib::Mocks::mock_preference('AnonymousPatron', $anonymous_borrowernumber); Please move it to its own bug report.
Created attachment 68330 [details] [review] Bug 19487: Refetch the object to get up-to-date values This has been raised by failures on t/db_dependent/Circulation/issue.t (thanks tests!)
Pushed to master for 17.11, thanks to everybody involved!
(In reply to Jonathan Druart from comment #10) > Comment on attachment 68313 [details] [review] [review] > Bug 19487: (QA follow-up) More changes to MarkIssueReturned.t > > I am not willing to push this patch. But you wanted to be RM ;) > We want a fix for stable releases, so something easy to backport. > This change is quite big may slow down the backport. OK OK > Moreover it seems that at least one test has been removed: > -unlike ( $@, qr<Fatal error: the patron \(\d+\) .* AnonymousPatron>, ); No it isnt. This one is even sharper.. +is( $@, '', 'No die triggered by invalid itemnumber' ); > and this line too, which makes me think you cut a bit too much: > t::lib::Mocks::mock_preference('AnonymousPatron', $anonymous_borrowernumber); Yes I removed it since it was made useless by the previous changes. When you pass a wrong item number, MarkIssueReturned will now return undef rightaway. The whole anynomous stuff is not in reach. Leaving it in could reflect that we are testing it, while we are not. > Please move it to its own bug report. Bug 19513
Pushed to 17.05.x, will be in 17.05.06
These patches have been pushed to 16.11.x and will be in 16.11.14.