Bug 36360 - Link ILL requests to surviving patron record when patrons are merged
Summary: Link ILL requests to surviving patron record when patrons are merged
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Pedro Amorim
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-19 16:31 UTC by Katrin Fischer
Modified: 2025-11-25 12:35 UTC (History)
8 users (show)

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: ---
Comma delimited list of Sponsors:
Crowdfunding goal: 0
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 36360: Add Illrequest to list of stuff to consider merging (819 bytes, patch)
2025-10-16 10:26 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 36360: Add tests (2.41 KB, patch)
2025-10-16 10:26 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 36360: Add Illrequest to list of stuff to consider merging (874 bytes, patch)
2025-11-25 12:35 UTC, OpenFifth Sandboxes
Details | Diff | Splinter Review
Bug 36360: Add tests (2.46 KB, patch)
2025-11-25 12:35 UTC, OpenFifth Sandboxes
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2024-03-19 16:31:43 UTC
When patrons are merged, the ILL requests of the deleted patron records are deleted as well. They should be re-linked to the remaining/winning patron record instead.
Comment 1 Pedro Amorim 2025-10-16 10:26:47 UTC
Created attachment 187984 [details] [review]
Bug 36360: Add Illrequest to list of stuff to consider merging
Comment 2 Pedro Amorim 2025-10-16 10:26:50 UTC
Created attachment 187985 [details] [review]
Bug 36360: Add tests

prove t/db_dependent/Koha/Patrons.t

Test plan, k-t-d:
1) Enable ILLModule
2) Create an ILL request for patron 'John', visit:
<staff_url>/cgi-bin/koha/ill/ill-requests.pl?method=create&backend=Standard
3) Type 'John' and pick the only result. Set a type and library. Click 'Create'.
4) Go to patrons search and search for 'jo':
<staff_url>/cgi-bin/koha/members/members-home.pl
5) Tick the checkbox for John and someone else from the list. Click 'Merge selected patrons' from the top toolbar
6) Select the other patron (not John) as the 'patron to keep'. Click Merge patrons.
7) Notice '1 Illrequest was merge' message shows.
8) Visit the ILL list table, visit:
<staff_url>/cgi-bin/koha/ill/ill-requests.pl
9) Notice the ILL request now belongs to the other patron, not John (who no longer exists).
Comment 3 OpenFifth Sandboxes 2025-11-25 12:35:01 UTC
Created attachment 189922 [details] [review]
Bug 36360: Add Illrequest to list of stuff to consider merging

Signed-off-by: Richard Bridgen <richard.bridgen@nhs.net>
Comment 4 OpenFifth Sandboxes 2025-11-25 12:35:03 UTC
Created attachment 189923 [details] [review]
Bug 36360: Add tests

prove t/db_dependent/Koha/Patrons.t

Test plan, k-t-d:
1) Enable ILLModule
2) Create an ILL request for patron 'John', visit:
<staff_url>/cgi-bin/koha/ill/ill-requests.pl?method=create&backend=Standard
3) Type 'John' and pick the only result. Set a type and library. Click 'Create'.
4) Go to patrons search and search for 'jo':
<staff_url>/cgi-bin/koha/members/members-home.pl
5) Tick the checkbox for John and someone else from the list. Click 'Merge selected patrons' from the top toolbar
6) Select the other patron (not John) as the 'patron to keep'. Click Merge patrons.
7) Notice '1 Illrequest was merge' message shows.
8) Visit the ILL list table, visit:
<staff_url>/cgi-bin/koha/ill/ill-requests.pl
9) Notice the ILL request now belongs to the other patron, not John (who no longer exists).

Signed-off-by: Richard Bridgen <richard.bridgen@nhs.net>