Bug 32569

Summary: CloneSubfield() and CloneField() function can result in duplicate ID's when using the upload cataloging plugin
Product: Koha Reporter: Lucas Gass (lukeg) <lucas>
Component: CatalogingAssignee: Bugs List <koha-bugs>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: minor    
Priority: P5 - low CC: f.demians, m.de.rooy
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on: 30975    
Bug Blocks:    

Description Lucas Gass (lukeg) 2023-01-04 22:02:38 UTC
This problem was exposed when trying to clone 856 fields while using the upload.pl cataloging plugin. 

To recreate:
1. Edit a framework so that the 856$u uses the upload.pl plugin.
2. Go to a record within that framework using the basic editor. 
3. Create and 856u, if you don't already have one. 
4. Now try and clone the entire field. Look at the ID on the upload button, it beings with 'buttonDot_tag_856_subfield_u_'
5. Notice that the ID is the same as the one you cloned it from. Because of this you cannot use the 2nd 'upload link'.
6. Save you changes and exit the basic editor.
7. Go back into the editor and the new fields now have a different ID and the upload links work correctly.
Comment 1 Marcel de Rooy 2023-11-09 09:37:29 UTC
This works for me. Apparently solved by bug 33744.
Please try again. Reopen if needed.
Comment 2 Marcel de Rooy 2023-11-09 09:42:40 UTC
Also note that 30975 still improves this code.