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.