Bug 17506 - Offline circ needs to be logged
Summary: Offline circ needs to be logged
Status: Failed QA
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: Main
Hardware: All All
: P1 - high enhancement with 11 votes (vote)
Assignee: Kyle M Hall
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on: 33838
Blocks: 22794
  Show dependency treegraph
 
Reported: 2016-10-26 19:15 UTC by Christopher Brannon
Modified: 2023-09-13 15:45 UTC (History)
9 users (show)

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


Attachments
Bug 17506: Offline circ needs to be logged (1.67 KB, patch)
2022-04-05 13:10 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 17506: Offline circ needs to be logged (1.63 KB, patch)
2023-03-07 14:20 UTC, Laura Escamilla
Details | Diff | Splinter Review
Offline circ fule (221 bytes, text/plain)
2023-05-25 15:34 UTC, Andrew Fuerste-Henry
Details
Bug 17506: Offline circ needs to be logged (1.62 KB, patch)
2023-05-25 15:48 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 17506: Offline circ needs to be logged (1.62 KB, patch)
2023-05-25 15:48 UTC, Kyle M Hall
Details | Diff | Splinter Review
log action error (217.58 KB, image/png)
2023-05-25 18:03 UTC, Andrew Fuerste-Henry
Details
Bug 17506: Offline circ needs to be logged (1.66 KB, patch)
2023-05-25 18:54 UTC, Andrew Fuerste-Henry
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Christopher Brannon 2016-10-26 19:15:05 UTC
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.
Comment 1 Andrew Fuerste-Henry 2022-03-28 15:04:03 UTC
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.
Comment 2 Rebecca Coert 2022-04-04 19:18:01 UTC
I agree with Christopher - all Offline Circulation transactions should be logged for possible troubleshooting.  Issues, Renewals AND Returns.
Comment 3 Kyle M Hall 2022-04-05 13:10:51 UTC
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
Comment 4 Christopher Brannon 2022-04-05 15:42:51 UTC
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
Comment 5 Laura Escamilla 2023-03-07 14:20:21 UTC
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
Comment 6 Andrew Fuerste-Henry 2023-05-25 15:34:02 UTC
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.
Comment 7 Kyle M Hall 2023-05-25 15:48:05 UTC
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
Comment 8 Kyle M Hall 2023-05-25 15:48:59 UTC
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
Comment 9 Christopher Brannon 2023-05-25 16:04:48 UTC
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?
Comment 10 Christopher Brannon 2023-05-25 16:05:32 UTC
Maybe in another bug???  Just wondering.
Comment 11 Andrew Fuerste-Henry 2023-05-25 16:08:54 UTC
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.
Comment 12 Andrew Fuerste-Henry 2023-05-25 18:03:42 UTC
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.
Comment 13 Kyle M Hall 2023-05-25 18:11:59 UTC
(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.
Comment 14 Andrew Fuerste-Henry 2023-05-25 18:54:31 UTC
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>
Comment 15 Andrew Fuerste-Henry 2023-05-25 18:54:58 UTC
(In reply to Kyle M Hall from comment #13)

> Are you testing with the latest version of the patch? 

Apparently not!
Comment 16 Marcel de Rooy 2023-09-08 07:31:54 UTC
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