I recently spent about an hour and a half going over logs trying to figure out why old checkouts were showing up on patron records, and the logs were not lining up. We finally came to the assumption that someone uploaded an old offline circ file. Unfortunately, there is nothing in the logs to record offline circ transactions, and nothing tied to the specific checkouts either. It would REALLY be helpful if the logs would record offline circ transactions, including date of upload, and date of the transaction. It would also be helpful if the item history would indicate a transaction through offline circ and when the transaction was processed. It would be really cool if I could get that hour and a half back.
Looking at the code for this today, it appears that checkouts and renewals *will* get written to the action logs from offline circ, but returns are not.
I agree with Christopher - all Offline Circulation transactions should be logged for possible troubleshooting. Issues, Renewals AND Returns.
Created attachment 132971 [details] [review] Bug 17506: Offline circ needs to be logged Returns via offline circ are not logged. Test Plan: 1) Via offline circ * Return some items checked out to patrons * Check out some items that are currently checked out to other patrons 2) Apply the offline circs to Koha 3) Note the checkouts are logged, but not the returns 4) Apply this patch, restart all the things! 5) Repeat steps 1 and 2 6) Note the checkins are now logged both for returns and for checkouts where the item was checked out to a different patron
I tried two provisions in a sandbox with this patch. Patch loaded, but when I restarted services in both provisions, I was greeted with these errors: Stopping Plack daemon for b17506:. Stopping Z39.50/SRU daemon for b17506:. Stopping Koha worker daemon for b17506:. Stopping Koha indexing daemon for b17506:. Starting Plack daemon for b17506:. Starting Z39.50/SRU daemon for b17506:"my" variable $operation masks earlier declaration in same scope at /kohadevbox/koha/C4/Circulation.pm line 4075. "my" variable $patron masks earlier declaration in same scope at /kohadevbox/koha/C4/Circulation.pm line 4077. syntax error at /kohadevbox/koha/C4/Circulation.pm line 4031, near "} else" Unmatched right curly bracket at /kohadevbox/koha/C4/Circulation.pm line 4034, at end of line Can't redeclare "my" in "my" at /kohadevbox/koha/C4/Circulation.pm line 4039, near "my" Global symbol "$operation" requires explicit package name (did you forget to declare "my $operation"?) at /kohadevbox/koha/C4/Circulation.pm line 4039. syntax error at /kohadevbox/koha/C4/Circulation.pm line 4069, near "}" Unmatched right curly bracket at /kohadevbox/koha/C4/Circulation.pm line 4072, at end of line Can't redeclare "my" in "my" at /kohadevbox/koha/C4/Circulation.pm line 4077, near "my" syntax error at /kohadevbox/koha/C4/Circulation.pm line 4088, near "}" Can't use global @_ in "my" at /kohadevbox/koha/C4/Circulation.pm line 4099, near "= @_" Global symbol "$itemnumber" requires explicit package name (did you forget to declare "my $itemnumber"?) at /kohadevbox/koha/C4/Circulation.pm line 4103. Global symbol "$itemnumber" requires explicit package name (did you forget to declare "my $itemnumber"?) at /kohadevbox/koha/C4/Circulation.pm line 4103. Global symbol "$barcode" requires explicit package name (did you forget to declare "my $barcode"?) at /kohadevbox/koha/C4/Circulation.pm line 4104. syntax error at /kohadevbox/koha/C4/Circulation.pm line 4118, near "}" /kohadevbox/koha/C4/Circulation.pm has too many errors. Compilation failed in require at /kohadevbox/koha/Koha/Items.pm line 27. BEGIN failed--compilation aborted at /kohadevbox/koha/Koha/Items.pm line 27. Compilation failed in require at /kohadevbox/koha/Koha/Recall.pm line 25. BEGIN failed--compilation aborted at /kohadevbox/koha/Koha/Recall.pm line 25. Compilation failed in require at /kohadevbox/koha/Koha/Recalls.pm line 23. BEGIN failed--compilation aborted at /kohadevbox/koha/Koha/Recalls.pm line 23. Compilation failed in require at /kohadevbox/koha/C4/XSLT.pm line 33. BEGIN failed--compilation aborted at /kohadevbox/koha/C4/XSLT.pm line 33. Compilation failed in require at /kohadevbox/koha/Koha/Biblio.pm line 27. BEGIN failed--compilation aborted at /kohadevbox/koha/Koha/Biblio.pm line 27. Compilation failed in require at /kohadevbox/koha/Koha/Biblios.pm line 25. BEGIN failed--compilation aborted at /kohadevbox/koha/Koha/Biblios.pm line 25. Compilation failed in require at /kohadevbox/koha/Koha/Libraries.pm line 25. BEGIN failed--compilation aborted at /kohadevbox/koha/Koha/Libraries.pm line 25. Compilation failed in require at /kohadevbox/koha/Koha/Object/Limit/Library.pm line 22. BEGIN failed--compilation aborted at /kohadevbox/koha/Koha/Object/Limit/Library.pm line 22. Compilation failed in require at /usr/lib/x86_64-linux-gnu/perl-base/base.pm line 135. ...propagated at /usr/lib/x86_64-linux-gnu/perl-base/base.pm line 157. BEGIN failed--compilation aborted at /kohadevbox/koha/Koha/AuthorisedValue.pm line 25. Compilation failed in require at /kohadevbox/koha/Koha/AuthorisedValues.pm line 25. BEGIN failed--compilation aborted at /kohadevbox/koha/Koha/AuthorisedValues.pm line 25. Compilation failed in require at /kohadevbox/koha/C4/Koha.pm line 27. BEGIN failed--compilation aborted at /kohadevbox/koha/C4/Koha.pm line 27. Compilation failed in require at /kohadevbox/koha/C4/Biblio.pm line 91. BEGIN failed--compilation aborted at /kohadevbox/koha/C4/Biblio.pm line 91. Compilation failed in require at /kohadevbox/koha/Koha/Z3950Responder.pm line 22. BEGIN failed--compilation aborted at /kohadevbox/koha/Koha/Z3950Responder.pm line 22. Compilation failed in require at /kohadevbox/koha/misc/z3950_responder.pl line 27. BEGIN failed--compilation aborted at /kohadevbox/koha/misc/z3950_responder.pl line 27. [31mfailed![39;49m Starting Koha worker daemon for b17506:. Starting Koha indexing daemon for b17506:. Reloading Apache httpd web server: apache2. memcached
Created attachment 147842 [details] [review] Bug 17506: Offline circ needs to be logged Returns via offline circ are not logged. Test Plan: 1) Via offline circ * Return some items checked out to patrons * Check out some items that are currently checked out to other patrons 2) Apply the offline circs to Koha 3) Note the checkouts are logged, but not the returns 4) Apply this patch, restart all the things! 5) Repeat steps 1 and 2 6) Note the checkins are now logged both for returns and for checkouts where the item was checked out to a different patron
Created attachment 151697 [details] Offline circ fule This koc file includes a checkout each to two different patrons and then the checkin of one of those items, all using the default testing data.
Created attachment 151698 [details] [review] Bug 17506: Offline circ needs to be logged Returns via offline circ are not logged. Test Plan: 1) Via offline circ * Return some items checked out to patrons * Check out some items that are currently checked out to other patrons 2) Apply the offline circs to Koha 3) Note the checkouts are logged, but not the returns 4) Apply this patch, restart all the things! 5) Repeat steps 1 and 2 6) Note the checkins are now logged both for returns and for checkouts where the item was checked out to a different patron
Created attachment 151699 [details] [review] Bug 17506: Offline circ needs to be logged Returns via offline circ are not logged. Test Plan: 1) Via offline circ * Return some items checked out to patrons * Check out some items that are currently checked out to other patrons 2) Apply the offline circs to Koha 3) Note the checkouts are logged, but not the returns 4) Apply this patch, restart all the things! 5) Repeat steps 1 and 2 6) Note the checkins are now logged both for returns and for checkouts where the item was checked out to a different patron
Haven't looked at this yet, but would it be helpful if offline circ file processing gave warnings on transactions that are older than the item's last timestamp?
Maybe in another bug??? Just wondering.
I see log entries for checkouts and for returns where the return was forced by a checkout to a different patron. I am not getting log entries for regular returns. Possibly related, a filed bug 33838 for some wonky display/interface stuff with returns.
Created attachment 151707 [details] log action error With 33838 patched the return logs correctly! I realized there's a tiny error with the return due to checkout to a different patron. It's recording "issue" for the action for that, instead of return. See attached screenshot in which item 3999900000002 is checked out to Edna via offline circ. The entry that's a checkout with no object should be a return.
(In reply to Andrew Fuerste-Henry from comment #12) > Created attachment 151707 [details] > log action error > > With 33838 patched the return logs correctly! > I realized there's a tiny error with the return due to checkout to a > different patron. It's recording "issue" for the action for that, instead of > return. See attached screenshot in which item 3999900000002 is checked out > to Edna via offline circ. The entry that's a checkout with no object should > be a return. Are you testing with the latest version of the patch? I caught a bug in it earlier that is now fixed.
Created attachment 151708 [details] [review] Bug 17506: Offline circ needs to be logged Returns via offline circ are not logged. Test Plan: 1) Via offline circ * Return some items checked out to patrons * Check out some items that are currently checked out to other patrons 2) Apply the offline circs to Koha 3) Note the checkouts are logged, but not the returns 4) Apply this patch, restart all the things! 5) Repeat steps 1 and 2 6) Note the checkins are now logged both for returns and for checkouts where the item was checked out to a different patron Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
(In reply to Kyle M Hall from comment #13) > Are you testing with the latest version of the patch? Apparently not!
sub ProcessOfflineIssue This is a bit weird. We are logging ISSUE when ReturnLog is enabled. What we probably should do here, is log both logging the return when ReturnLog is eanbled and logging the issue when IssueLog is enabled after AddIssue. FQA
Created attachment 176184 [details] [review] Bug 17506: Offline circ needs to be logged Returns via offline circ are not logged. Test Plan: 1) Via offline circ * Return some items checked out to patrons * Check out some items that are currently checked out to other patrons 2) Apply the offline circs to Koha 3) Note the checkouts are logged, but not the returns 4) Apply this patch, restart all the things! 5) Repeat steps 1 and 2 6) Note the checkins are now logged both for returns and for checkouts where the item was checked out to a different patron Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Created attachment 176185 [details] [review] Bug 17506: (follow-up) Check IssueLog syspref when logging offline checkout