When testing bug 12467 I foudn that the --mark-returned flag didn't return the items as it was supposed to. The items got marked lost, but remained on the patron's account.
How do you launch the cronjob? It seems that the --charge option is required (or the pref) to mark the item as returned. I don't understand the following code: 185 ModItem({ itemlost => $lostvalue }, $row->{'biblionumber'}, $row->{'itemnumber'}); 186 LostItem($row->{'itemnumber'}, $mark_returned) if( $charge && $charge eq $lostvalue); If the charge and the lostvalue don't match, the item won't be marked as returned, so if it needs to be marked as returned, we should move the MarkIssueReturned from the LostItem subroutine.
Created attachment 71336 [details] [review] Bug 12812 - Longoverdue.pl --mark-returned doesn't return items The longoverdue.pl option --mark-returned doesn't work unless the --charge option is used as well. Test Plan: 1) Run long overdue with --mark-returned and not --charge, note your items are marked lost but not returned 2) Apply this patch 3) Repeat step 1, the items should now get returned!
Created attachment 72544 [details] [review] Bug 12812: Longoverdue.pl --mark-returned doesn't return items The longoverdue.pl option --mark-returned doesn't work unless the --charge option is used as well. Test Plan: 1) Run long overdue with --mark-returned and not --charge, note your items are marked lost but not returned 2) Apply this patch 3) Repeat step 1, the items should now get returned! Tested with (for example): misc/cronjobs/longoverdue.pl --lost 10=1 --mark-returned --verbose --confirm Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Created attachment 72545 [details] [review] Bug 12812: (Follow-up) Fix use of C4::Circulation Fixes this error: Undefined subroutine &main::MarkIssueReturned called at misc/cronjobs/longoverdue.pl line 316. Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Created attachment 72564 [details] [review] Bug 12812: Longoverdue.pl --mark-returned doesn't return items The longoverdue.pl option --mark-returned doesn't work unless the --charge option is used as well. Test Plan: 1) Run long overdue with --mark-returned and not --charge, note your items are marked lost but not returned 2) Apply this patch 3) Repeat step 1, the items should now get returned! Tested with (for example): misc/cronjobs/longoverdue.pl --lost 10=1 --mark-returned --verbose --confirm Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Created attachment 72565 [details] [review] Bug 12812: (Follow-up) Fix use of C4::Circulation Fixes this error: Undefined subroutine &main::MarkIssueReturned called at misc/cronjobs/longoverdue.pl line 316. Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Pushed to master for 18.05, thanks to all for your hard work.
Awesome work all, backported to stable for 17.11.05
Pushed to 17.05.x for v17.05.11