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.