[Bug 29380] New: Auto renewing, batch due date extension tool and checkout note previews are broken
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29380 Bug ID: 29380 Summary: Auto renewing, batch due date extension tool and checkout note previews are broken Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: ASSIGNED Severity: critical Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: joonas.kylmala@iki.fi Reporter: joonas.kylmala@iki.fi QA Contact: testopia@bugs.koha-community.org CC: jonathan.druart+koha@gmail.com, martin.renvoize@ptfs-europe.com, tomascohen@gmail.com Depends on: 29290 The table joins were not changed to use the new name in bug 29290 so a few scripts got broken. Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29290 [Bug 29290] Add routes to fetch checkouts for a given biblio -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29380 Joonas Kylmälä <joonas.kylmala@iki.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29380 --- Comment #1 from Joonas Kylmälä <joonas.kylmala@iki.fi> --- Created attachment 127109 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=127109&action=edit Bug 29380: Correct table name in joins to prevent errors The commit "Bug 29290: Rename relationships borrower => patron" (d46492ac23) renamed the relation for the borrowers table from 'borrower' to 'patron' but the joins were not updated accordingly so a few scripts got broken. To test: 1) Notice that $ perl misc/cronjobs/automatic_renewals.pl -c -s -v returns 255 error code on exit 2) Apply patch 3) Notice the automatic_renewals.pl works now and exit code is 0 4) Make sure /cgi-bin/koha/tools/batch_extend_due_dates.pl works. 5) Try to grep for 'borrower' in Koha source code and see if there are any other join done using the Koha::Checkout or Koha::Old::Checkout objects. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29380 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29380 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #127109|0 |1 is obsolete| | --- Comment #2 from David Nind <david@davidnind.com> --- Created attachment 127126 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=127126&action=edit Bug 29380: Correct table name in joins to prevent errors The commit "Bug 29290: Rename relationships borrower => patron" (d46492ac23) renamed the relation for the borrowers table from 'borrower' to 'patron' but the joins were not updated accordingly so a few scripts got broken. To test: 1) Notice that $ perl misc/cronjobs/automatic_renewals.pl -c -s -v returns 255 error code on exit 2) Apply patch 3) Notice the automatic_renewals.pl works now and exit code is 0 4) Make sure /cgi-bin/koha/tools/batch_extend_due_dates.pl works. 5) Try to grep for 'borrower' in Koha source code and see if there are any other join done using the Koha::Checkout or Koha::Old::Checkout objects. Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29380 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com --- Comment #3 from David Nind <david@davidnind.com> --- Testing notes (using koha-testing-docker in strict SQL mode - the default when starting with ku). Setup for testing ~~~~~~~~~~~~~~~~~ 1. AutoRenewalNotices system preference - set to "according to patron messaging preferences". 2. Checked out some items to patrons (I checked out one item to three different patrons) - when checking out expanded "Checkout settings" and selected automatic renewal and added a date before the current date for "Specify the due date". 3. For those patrons added an email address (name@example.com for example) and changed their patron messaging preferences to enable email notification for auto renewal. Error message before patch applied ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ I didn't get "returns 255 error code on exit", but it clearly wasn't working as I got: perl misc/cronjobs/automatic_renewals.pl -c -s -v getting auto renewals No method count found for Koha::Checkouts DBIx::Class::ResultSource::_resolve_join(): No such relationship borrower on Issue at /kohadevbox/koha/Koha/Objects.pm line 601 at misc/cronjobs/automatic_renewals.pl line 136. Use of uninitialized value in concatenation (.) or string at misc/cronjobs/automatic_renewals.pl line 136. found auto renewals DBIx::Class::ResultSource::_resolve_join(): No such relationship borrower on Issue at /kohadevbox/koha/Koha/Objects.pm line 335 After applying patch and running automatic renewals ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1. Checked the check outs for patrons and made sure items were renewed - noted new due dates. 2. Checked notices for patrons and made sure a notice for automatic renewal was added. 3. Used the batch extend due dates tool (Tools > Patrons and circulation > Batch extend due dates) to extend the due dates for items issued to the 31 December 2021 - the preview listed the items checked out to patrons and the dates were extended. Step 5 - grep for borrower ~~~~~~~~~~~~~~~~~~~~~~~~~~ Not exactly sure what I was looking for, feel free to change back to sign off if this is not sufficient: 1. Did git greps for Koha::Old::Checkout and Koha::Checkout and saved results to a file. Then searched those files for join and borrower. 2. Did a git grep for borrower and saved results to a file. Searched that file for occurrences of Koha::Old::Checkout and Koha::Checkout that mentioned join and borrower. Only one item I came across but there is no join, so I don't think tat counts: t/db_dependent/Members/IssueSlip.t: or diag(Dumper(Koha::Checkouts->search({borrowernumber => $borrower->{borrowernumber}})->unblessed)); -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29380 Joonas Kylmälä <joonas.kylmala@iki.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |gmcharlt@gmail.com, | |kyle.m.hall@gmail.com Component|Architecture, internals, |Circulation |and plumbing | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29380 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #127126|0 |1 is obsolete| | --- Comment #4 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 127143 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=127143&action=edit Bug 29380: Correct table name in joins to prevent errors The commit "Bug 29290: Rename relationships borrower => patron" (d46492ac23) renamed the relation for the borrowers table from 'borrower' to 'patron' but the joins were not updated accordingly so a few scripts got broken. To test: 1) Notice that $ perl misc/cronjobs/automatic_renewals.pl -c -s -v returns 255 error code on exit 2) Apply patch 3) Notice the automatic_renewals.pl works now and exit code is 0 4) Make sure /cgi-bin/koha/tools/batch_extend_due_dates.pl works. 5) Try to grep for 'borrower' in Koha source code and see if there are any other join done using the Koha::Checkout or Koha::Old::Checkout objects. Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29380 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA --- Comment #5 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Damn, annoyed I missed this during QA of the cause bug :(. This appears to catch all cases, I couldn't find any more myself. Passing QA, thanks for the quick spot and fix Joonas! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29380 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |rel_21_11_candidate -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29380 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29380 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Failed QA --- Comment #6 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- This one seems valid as well: circ/renew.pl 66 $borrower = $issue->borrower(); Can't locate object method "borrower" via package "Koha::Schema::Result::Issue" at /kohadevbox/koha/circ/renew.pl line 66 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29380 Joonas Kylmälä <joonas.kylmala@iki.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29380 --- Comment #7 from Joonas Kylmälä <joonas.kylmala@iki.fi> --- Created attachment 127226 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=127226&action=edit Bug 29380: (follow-up) Fix renewal feature in staff interface The commit "Bug 29290: Rename relationships borrower => patron" (d46492ac23) renamed the relation for the borrowers table from 'borrower' to 'patron' but the usage in the renew.pl script was not updated. To test: 1) Try to renew a book in intranet through the renewal tab 2) Notice it gives error 3) Apply patch 4) Notice the error is now gone Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29380 --- Comment #8 from Joonas Kylmälä <joonas.kylmala@iki.fi> --- (In reply to Jonathan Druart from comment #6)
This one seems valid as well: circ/renew.pl
fixed. I grepped another time for similar ones to this but couldn't find more. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29380 --- Comment #9 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Patches will be squashed when pushed. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29380 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |21.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=29380 --- Comment #10 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Pushed to master for 21.11, thanks to everybody involved! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29380 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|rel_21_11_candidate | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29380 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kyle@bywatersolutions.com Status|Pushed to master |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org