[Bug 36508] New: Patron userid field can be overwritten by update_patron_categories when limiting by fines
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36508 Bug ID: 36508 Summary: Patron userid field can be overwritten by update_patron_categories when limiting by fines Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: critical Priority: P5 - low Component: Command-line Utilities Assignee: koha-bugs@lists.koha-community.org Reporter: nick@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org CC: robin@catalyst.net.nz In Koha::Patrons->search_patrons_to_update_category we join to accountlines and sum when using the fines over and fines under parameters. The way this sql works requires a GROUP BY - which means we limit the columns to borrowernumber This means the object we use to update later loses many of the fields we expect to be there We end up with entries in modification log like: { "address" : { "after" : null, "before" : "5129 Library Rd." }, "auth_method" : { "after" : null, "before" : "password" }, "autorenew_checkouts" : { "after" : null, "before" : 1 }, "branchcode" : { "after" : null, "before" : "MPL" }, "cardnumber" : { "after" : null, "before" : "23529000050113" }, "categorycode" : { "after" : "S", "before" : "ST" }, "checkprevcheckout" : { "after" : null, "before" : "inherit" }, "city" : { "after" : null, "before" : "Centerville, CA" }, "dateenrolled" : { "after" : null, "before" : "1985-09-09" }, "dateexpiry" : { "after" : null, "before" : "2099-12-31" }, "dateofbirth" : { "after" : null, "before" : "1952-05-27" }, "firstname" : { "after" : null, "before" : "Jordan" }, "lang" : { "after" : null, "before" : "default" }, "phone" : { "after" : null, "before" : "(212) 555-1212" }, "privacy" : { "after" : null, "before" : 1 }, "sex" : { "after" : null, "before" : "M" }, "sort1" : { "after" : null, "before" : "0.54121395064631" }, "sort2" : { "after" : null, "before" : "0.90967674824379" }, "surname" : { "after" : null, "before" : "Alford" }, "userid" : { "after" : "1", "before" : "23529000050113" }, "zipcode" : { "after" : null, "before" : "44262" } } Most of these are ignored, null interpreting as not being updated, however, the cardnumber does overwrite as it is treated specially. -- 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=36508 --- Comment #1 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 164391 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=164391&action=edit Bug 36508: Refresh patron object when updating category To test: 1 - Find a ptron, I sued #45 in KTD, note their category 2 - Update them from one category to another using finesunder: perl misc/cronjobs/update_patrons_category.pl -f ST -t S --finesunder=5.00 --where "me.borrowernumber=45" -v -c 3 - Check their modification log (I told you to enabled BorrowersLog, right?) 4 - See many fields reported changed 5 - Apply patch 6 - Repeat, but change the to and from options perl misc/cronjobs/update_patrons_category.pl -f S -t ST --finesunder=5.00 --where "me.borrowernumber=45" -v -c 7 - Note only one column changed in the logs 8 - Ask for unit tests -- 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=36508 Nick Clemens <nick@bywatersolutions.com> 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=36508 --- Comment #2 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 165571 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=165571&action=edit Bug 36508: Unit tests -- 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=36508 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #164391|0 |1 is obsolete| | --- Comment #3 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 165572 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=165572&action=edit Bug 36508: Refresh patron object when updating category To test: 1 - Find a ptron, I sued #45 in KTD, note their category 2 - Update them from one category to another using finesunder: perl misc/cronjobs/update_patrons_category.pl -f ST -t S --finesunder=5.00 --where "me.borrowernumber=45" -v -c 3 - Check their modification log (I told you to enabled BorrowersLog, right?) 4 - See many fields reported changed 5 - Apply patch 6 - Repeat, but change the to and from options perl misc/cronjobs/update_patrons_category.pl -f S -t ST --finesunder=5.00 --where "me.borrowernumber=45" -v -c 7 - Note only one column changed in the logs 8 - Ask for unit tests -- 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=36508 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |nick@bywatersolutions.com |ity.org | -- 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=36508 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch 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=36508 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #165571|0 |1 is obsolete| | Attachment #165572|0 |1 is obsolete| | --- Comment #4 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 165574 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=165574&action=edit Bug 36508: Unit tests Signed-off-by: Owen Leonard <oleonard@myacpl.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36508 --- Comment #5 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 165575 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=165575&action=edit Bug 36508: Refresh patron object when updating category To test: 1 - Find a ptron, I sued #45 in KTD, note their category 2 - Update them from one category to another using finesunder: perl misc/cronjobs/update_patrons_category.pl -f ST -t S --finesunder=5.00 --where "me.borrowernumber=45" -v -c 3 - Check their modification log (I told you to enabled BorrowersLog, right?) 4 - See many fields reported changed 5 - Apply patch 6 - Repeat, but change the to and from options perl misc/cronjobs/update_patrons_category.pl -f S -t ST --finesunder=5.00 --where "me.borrowernumber=45" -v -c 7 - Note only one column changed in the logs 8 - Ask for unit tests Signed-off-by: Owen Leonard <oleonard@myacpl.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36508 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |tomascohen@gmail.com |y.org | CC| |tomascohen@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36508 Tomás Cohen Arazi <tomascohen@gmail.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=36508 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #165574|0 |1 is obsolete| | Attachment #165575|0 |1 is obsolete| | --- Comment #6 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 165784 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=165784&action=edit Bug 36508: Unit tests Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36508 --- Comment #7 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 165785 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=165785&action=edit Bug 36508: Refresh patron object when updating category To test: 1 - Find a ptron, I sued #45 in KTD, note their category 2 - Update them from one category to another using finesunder: perl misc/cronjobs/update_patrons_category.pl -f ST -t S --finesunder=5.00 --where "me.borrowernumber=45" -v -c 3 - Check their modification log (I told you to enabled BorrowersLog, right?) 4 - See many fields reported changed 5 - Apply patch 6 - Repeat, but change the to and from options perl misc/cronjobs/update_patrons_category.pl -f S -t ST --finesunder=5.00 --where "me.borrowernumber=45" -v -c 7 - Note only one column changed in the logs 8 - Ask for unit tests Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36508 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to main Version(s)| |24.05.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=36508 --- Comment #8 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Pushed for 24.05! 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=36508 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|24.05.00 |24.05.00,23.11.06 released in| | CC| |fridolin.somers@biblibre.co | |m Status|Pushed to main |Pushed to stable --- Comment #9 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 23.11.x for 23.11.06 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36508 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |Pushed to oldstable Version(s)|24.05.00,23.11.06 |24.05.00,23.11.06,23.05.12 released in| | CC| |lucas@bywatersolutions.com --- Comment #10 from Lucas Gass <lucas@bywatersolutions.com> --- Backported to 23.05.x for upcoming 23.05.12 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org