[Bug 37016] New: SIP2 renew shows old/wrong date due
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37016 Bug ID: 37016 Summary: SIP2 renew shows old/wrong date due Change sponsored?: --- Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: SIP2 Assignee: koha-bugs@lists.koha-community.org Reporter: magnus@libriotech.no QA Contact: testopia@bugs.koha-community.org This was reported by a library running 23.11.03. Sometimes when patrons do renewals via SIP2, the old due date is reported as the new due date. But everything else looks OK, including the staff view and "my profile", which shows the right due date. It looks like this only happens some of the time, or for some patrons, but I have not been able to figure out what the difference is there. I do think I have spotted the problem, though. C4::Circulation::AddIssue() has this code: 1552 my $issue; ... 1571 # find which item we issue 1572 my $item_object = Koha::Items->find({ barcode => $barcode }) 1573 or return; # if we don't get an Item, abort. 1574 my $item_unblessed = $item_object->unblessed; 1575 1576 my $branchcode = _GetCircControlBranch( $item_object, $patron ); 1577 1578 # get actual issuing if there is one 1579 my $actualissue = $item_object->checkout; 1580 1581 # check if we just renew the issue. 1582 if ( $actualissue and $actualissue->borrowernumber eq $patron->borrowernumber 1583 and not $switch_onsite_checkout ) { 1584 $datedue = AddRenewal( 1585 { 1586 borrowernumber => $patron->borrowernumber, 1587 itemnumber => $item_object->itemnumber, 1588 branch => $branchcode, 1589 datedue => $datedue, 1590 lastreneweddate => 1591 $issuedate, # here interpreted as the renewal date 1592 } 1593 ); 1594 $issue = $item_object->checkout; 1595 } We get the $item_object on line 1572. Then we get the active issue/loan/checkout from the $item_object on line 1579. Renewal is done on line 1584 (and testing shows $datedue has the right date due there). But then we update $issue with the active issue/loan/checkout from the same $item_object as earlier, which has not been updated, and contains stale data, including the original date due. I was able to quickfix this by replacing line 1594 with this: my $updated_item_object = my $item_object = Koha::Items->find({ barcode => $barcode }); $issue = $updated_item_object->checkout; But I am far from confident that this is a good fix, so opinions are welcome! -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37016 Andreas Jonsson <andreas.jonsson@kreablo.se> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |andreas.jonsson@kreablo.se --- Comment #1 from Andreas Jonsson <andreas.jonsson@kreablo.se> --- It looks like you can use the get_from_storage method: DB<14> x $item->checkout->unblessed; 0 HASH(0x5624163e5780) 'auto_renew' => 0 'auto_renew_error' => undef 'borrowernumber' => 190 'branchcode' => 'LA' 'date_due' => '2024-06-13 23:59:00' 'issue_id' => 208 'issuedate' => '2024-06-13 15:38:17' 'issuer_id' => undef 'itemnumber' => 310173 'lastreneweddate' => undef 'note' => undef 'notedate' => undef 'noteseen' => undef 'onsite_checkout' => 0 'renewals_count' => 0 'returndate' => undef 'timestamp' => '2024-06-13 15:38:17' 'unseen_renewals' => 0 DB<15> x $item->checkout->get_from_storage->unblessed; 0 HASH(0x5624163e36c0) 'auto_renew' => 0 'auto_renew_error' => undef 'borrowernumber' => 190 'branchcode' => 'LA' 'date_due' => '2024-06-13 23:59:00' 'issue_id' => 208 'issuedate' => '2024-06-13 15:38:17' 'issuer_id' => undef 'itemnumber' => 310173 'lastreneweddate' => '2024-06-13 15:40:00' 'note' => undef 'notedate' => undef 'noteseen' => undef 'onsite_checkout' => 0 'renewals_count' => 1 'returndate' => undef 'timestamp' => '2024-06-13 15:40:00' 'unseen_renewals' => 0 -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37016 --- Comment #2 from Andreas Jonsson <andreas.jonsson@kreablo.se> --- Created attachment 167688 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=167688&action=edit Bug 37016: Invalid due date in SIP renew response Test plan using koha-testing-docker: 1) Make sure SIP is running. You may need to edit /etc/koha/sites/SIPconfig.xml and remove the 8023 connector and restart the SIP-server (koha-sip --restart kohadev) 2) Find a patron, say 23529000197047 3) Set a password by selecting "change password", set it to "Password1234" 4) Find a book, say 39999000000856 5) Issue book to patron with sip-client: sudo koha-shell -c "/usr/share/koha/bin/sip_cli_emulator.pl \ --address localhost --port 6001 -t cr \ --su term1 --sp term1 --message checkout \ --location CPL --item 39999000000856 \ --patron 23529000197047 --password Password1234"\ kohadev 6) Note the AH-header in the response which for example: 'AH20240619 235900' 7) Make a renewal with: sudo koha-shell -c "/usr/share/koha/bin/sip_cli_emulator.pl \ --address localhost --port 6001 -t cr \ --su term1 --sp term1 --message renew \ --location CPL --item 39999000000856 \ --patron 23529000197047 --password Password1234"\ kohadev 8) Make sure the AH-header in the response is different from the response to the checkout, for example: 'AH20240624 235900' -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37016 Andreas Jonsson <andreas.jonsson@kreablo.se> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37016 Andreas Jonsson <andreas.jonsson@kreablo.se> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P5 - low |P3 Patch complexity|--- |Trivial patch Text to go in the| |Set correct due date in release notes| |SIP2 renewal response | |message. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37016 HKS3 Tadeusz Sośnierz <tadeusz@sosnierz.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37016 HKS3 Tadeusz Sośnierz <tadeusz@sosnierz.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #167688|0 |1 is obsolete| | --- Comment #3 from HKS3 Tadeusz Sośnierz <tadeusz@sosnierz.com> --- Created attachment 167712 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=167712&action=edit Bug 37016: Invalid due date in SIP renew response Test plan using koha-testing-docker: 1) Make sure SIP is running. You may need to edit /etc/koha/sites/SIPconfig.xml and remove the 8023 connector and restart the SIP-server (koha-sip --restart kohadev) 2) Find a patron, say 23529000197047 3) Set a password by selecting "change password", set it to "Password1234" 4) Find a book, say 39999000000856 5) Issue book to patron with sip-client: sudo koha-shell -c "/usr/share/koha/bin/sip_cli_emulator.pl \ --address localhost --port 6001 -t cr \ --su term1 --sp term1 --message checkout \ --location CPL --item 39999000000856 \ --patron 23529000197047 --password Password1234"\ kohadev 6) Note the AH-header in the response which for example: 'AH20240619 235900' 7) Make a renewal with: sudo koha-shell -c "/usr/share/koha/bin/sip_cli_emulator.pl \ --address localhost --port 6001 -t cr \ --su term1 --sp term1 --message renew \ --location CPL --item 39999000000856 \ --patron 23529000197047 --password Password1234"\ kohadev 8) Make sure the AH-header in the response is different from the response to the checkout, for example: 'AH20240624 235900' Signed-off-by: Tadeusz „tadzik” Sośnierz <tadeusz@sosnierz.com> -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37016 Nick Clemens (kidclamp) <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |andreas.jonsson@kreablo.se |ity.org | CC| |nick@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37016 Nick Clemens (kidclamp) <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37016 --- Comment #4 from Nick Clemens (kidclamp) <nick@bywatersolutions.com> --- Created attachment 168152 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168152&action=edit Bug 37016: Unit tests Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37016 Nick Clemens (kidclamp) <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #167712|0 |1 is obsolete| | --- Comment #5 from Nick Clemens (kidclamp) <nick@bywatersolutions.com> --- Created attachment 168153 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168153&action=edit Bug 37016: Invalid due date in SIP renew response Test plan using koha-testing-docker: 1) Make sure SIP is running. You may need to edit /etc/koha/sites/SIPconfig.xml and remove the 8023 connector and restart the SIP-server (koha-sip --restart kohadev) 2) Find a patron, say 23529000197047 3) Set a password by selecting "change password", set it to "Password1234" 4) Find a book, say 39999000000856 5) Issue book to patron with sip-client: sudo koha-shell -c "/usr/share/koha/bin/sip_cli_emulator.pl \ --address localhost --port 6001 -t cr \ --su term1 --sp term1 --message checkout \ --location CPL --item 39999000000856 \ --patron 23529000197047 --password Password1234"\ kohadev 6) Note the AH-header in the response which for example: 'AH20240619 235900' 7) Make a renewal with: sudo koha-shell -c "/usr/share/koha/bin/sip_cli_emulator.pl \ --address localhost --port 6001 -t cr \ --su term1 --sp term1 --message renew \ --location CPL --item 39999000000856 \ --patron 23529000197047 --password Password1234"\ kohadev 8) Make sure the AH-header in the response is different from the response to the checkout, for example: 'AH20240624 235900' Signed-off-by: Tadeusz „tadzik” Sośnierz <tadeusz@sosnierz.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37016 Nick Clemens (kidclamp) <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |37200 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37200 [Bug 37200] SIP2 Renewal uses AddIssue -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37016 --- Comment #6 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Test plan is really nice, but please also include a little summary about the problem and the solution :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37016 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to main Version(s)| |24.11.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37016 --- Comment #7 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Pushed for 24.11! Well done everyone, thank you! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37016 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com Status|Pushed to main |Pushed to stable Version(s)|24.11.00 |24.11.00,24.05.02 released in| | --- Comment #8 from Lucas Gass <lucas@bywatersolutions.com> --- Backported to 24.05.x for upcoming 24.05.02 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37016 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m Status|Pushed to stable |Pushed to oldstable Version(s)|24.11.00,24.05.02 |24.11.00,24.05.02,23.11.07 released in| | --- Comment #9 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 23.11.x for 23.11.07 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37016 wainuiwitikapark@catalyst.net.nz changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |wainuiwitikapark@catalyst.n | |et.nz --- Comment #10 from wainuiwitikapark@catalyst.net.nz --- Not backporting to 23.05.x unless requested -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37016 Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to oldstable |Needs documenting --- Comment #11 from Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> --- Not backporting to 22.11 unless requested -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37016 Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED CC| |caroline.cyr-la-rose@inlibr | |o.com Status|Needs documenting |RESOLVED --- Comment #12 from Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> --- Bug fix, nothing to change in the manual. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org