[Bug 44330] New: Merging patrons deletes the merged patron's recalls, bookings, return claims and other records
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44330 Bug ID: 44330 Summary: Merging patrons deletes the merged patron's recalls, bookings, return claims and other records Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: major Priority: P5 - low Component: Patrons Assignee: koha-bugs@lists.koha-community.org Reporter: babarjunaid1122@gmail.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle@bywatersolutions.com Target Milestone: --- Koha::Patron->merge_with moves the rows listed in $RESULTSET_PATRON_ID_MAPPING to the patron kept, then deletes the merged patron. Tables that point at a patron with ON DELETE CASCADE and are not in that list are deleted with the patron: recalls, bookings, return claims, discharges, serial alerts (alert), ILL comments, OPAC problem reports and catalog concerns (tickets.reporter_id). To reproduce (main): 1. Patron B places a recall and has a booking (or a return claim). 2. Patrons > merge B into patron A. 3. The recall and the booking are gone; A has none. The new subtest in t/db_dependent/Koha/Patrons.t gives the merged patron one row of each and checks they belong to the patron kept after the merge (all 8 fail without the patch). Routing lists are bug 39841 and need more than a mapping line (subscriptionroutinglist has a unique key on subscriptionid + borrowernumber), so they are not in this patch. Bug 20636 would add a test that every patron foreign key is mapped; this is the list such a test finds today. See Also 39841, 20636. Note for testers: on main, Patrons.t already fails '->set_password' and 'no warnings' in KTD without this patch. -- 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=44330 --- Comment #1 from babar junaid <babarjunaid1122@gmail.com> --- Created attachment 212773 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=212773&action=edit Bug 44330: Keep the merged patron's recalls, bookings, return claims and other records Bug 44330: Keep the merged patron's recalls, bookings, return claims and other records Koha::Patron->merge_with() moves the rows of the tables listed in $RESULTSET_PATRON_ID_MAPPING to the patron kept, then deletes the merged patron. Tables that point at a patron with ON DELETE CASCADE and are not in that list were deleted with the patron: recalls, bookings, return claims, discharges, serial alerts, ILL comments, OPAC problem reports and catalog concerns. They are added to the mapping. Routing lists (bug 39841) need more than a mapping line and are not in this patch. Test plan: 1. Apply only the test file change and run prove t/db_dependent/Koha/Patrons.t The new subtest "merge_with keeps the merged patron's recalls, bookings, return claims and other records" fails all 8 of its tests. 2. Apply the whole patch and run it again: the new subtest and "Test Koha::Patrons::merge" pass. Note: '->set_password' and 'no warnings' already fail on main in KTD without this patch. Sponsored-by: Koha Solutions -- 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=44330 babar junaid <babarjunaid1122@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |babarjunaid1122@gmail.com |ity.org | Status|NEW |Needs Signoff -- 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=44330 babar junaid <babarjunaid1122@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=39841, | |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=20636 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org