Bug 31460

Summary: Merging biblio records with attached item groups losing groups
Product: Koha Reporter: Kelly McElligott <kelly>
Component: CatalogingAssignee: Nick Clemens (kidclamp) <nick>
Status: Pushed to oldstable --- QA Contact: Jonathan Druart <jonathan.druart>
Severity: normal    
Priority: P5 - low CC: andrew, blawlor, fridolin.somers, george, hebah, jonathan.druart, lucas, m.de.rooy, mnero, nick, phillip.berg
Version: unspecifiedKeywords: release-notes-needed
Hardware: All   
OS: All   
GIT URL: Initiative type: ---
Sponsorship status: --- Crowdfunding goal: 0
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
25.11.00,25.05.04,24.11.10
Circulation function:
Bug Depends on: 24857    
Bug Blocks:    
Attachments: Bug 31460: Merge item groups when merging records
Bug 31460: Merge item groups when merging records
Bug 31460: Merge item groups when merging records

Description Kelly McElligott 2022-08-25 11:32:38 UTC
With the new feature of Item Groups, if a library merges two records together, both having Items with Item Groups attached, the merge will only retain the Item Group on the Kept Record. It would be beneficial to libraries that all item information including groups is retained in a merge. 

Test:
1. Have a record (A) with 3 items.  
2. Create an item group with 2 of these items.
3. Have a second record (B) with 4 items
4. Create an item group with 2 of these items.
5. Merge the two records together keeping record A
6. Results will show that all items are moved over to record A, but the item group from record B, is not there.
Comment 1 Miranda Nero 2025-07-22 16:22:32 UTC
We are encountering this bug frequently. This is especially cumbersome when there are item group-level holds on the records. We have been manually reassigning the item groups when there are only a handful of items the records being merged but have had to open tickets to get Bywater's assistance on records with larger numbers of records attached. Sometimes the description of the item group comes over with the item, so on the holdings tab it looks like the items are in an item group, but the item group doesn't exist.
Comment 2 Phillip Berg 2025-09-03 13:43:29 UTC
Agreed. This is something that is especially painful the larger the library system/consortium is.
Comment 3 Nick Clemens (kidclamp) 2025-09-04 12:28:35 UTC
Created attachment 186142 [details] [review]
Bug 31460: Merge item groups when merging records

Test:
1. Have a record (A) with 3 items.
2. Create an item group with 2 of these items.
3. Have a second record (B) with 4 items
4. Create an item group with 2 of these items.
5. Merge the two records together keeping record A
6. Results will show that all items are moved over to record A, but the item group from record B, is not there.
7. Apply patch
8. Create a new record (C) with 3 items.
9. Create an item group with 2 of these items
10. Merge this into record A
11. The item groups are moved!
Comment 4 Biblibre Sandboxes 2025-09-04 18:58:29 UTC
Created attachment 186178 [details] [review]
Bug 31460: Merge item groups when merging records

Test:
1. Have a record (A) with 3 items.
2. Create an item group with 2 of these items.
3. Have a second record (B) with 4 items
4. Create an item group with 2 of these items.
5. Merge the two records together keeping record A
6. Results will show that all items are moved over to record A, but the item group from record B, is not there.
7. Apply patch
8. Create a new record (C) with 3 items.
9. Create an item group with 2 of these items
10. Merge this into record A
11. The item groups are moved!

Signed-off-by: Miranda <mnero@oslri.net>
Comment 5 Jonathan Druart 2025-09-16 13:27:52 UTC
Created attachment 186486 [details] [review]
Bug 31460: Merge item groups when merging records

Test:
1. Have a record (A) with 3 items.
2. Create an item group with 2 of these items.
3. Have a second record (B) with 4 items
4. Create an item group with 2 of these items.
5. Merge the two records together keeping record A
6. Results will show that all items are moved over to record A, but the item group from record B, is not there.
7. Apply patch
8. Create a new record (C) with 3 items.
9. Create an item group with 2 of these items
10. Merge this into record A
11. The item groups are moved!

Signed-off-by: Miranda Nero <mnero@oslri.net>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 6 Jonathan Druart 2025-09-16 13:29:38 UTC
Miranda, I’ve updated the Signed-off-by line in the patch so that your full name will appear in the release notes. I hope that’s fine with you. If not, please let us know!
Comment 7 Miranda Nero 2025-09-16 15:43:33 UTC
Thanks, Jonathan! I'm not sure why my last name didn't get added when I signed off but glad it's all set now.
Comment 8 Lucas Gass (lukeg) 2025-09-18 19:53:47 UTC
Nice work everyone!

Pushed to main for 25.11
Comment 9 Paul Derscheid 2025-09-25 16:29:47 UTC
Nice work everyone!

Pushed to 25.05.x
Comment 10 Fridolin Somers 2025-10-16 08:32:19 UTC
Pushed to 24.11.x for 24.11.10