Bug 17152

Summary: Duplicating a subfield should not copy the data
Product: Koha Reporter: Sophie MEYNIEUX <sophie.meynieux>
Component: CatalogingAssignee: Héctor Eduardo Castro Avalos <hector.hecaxmmx>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: f.demians, hector.hecaxmmx, jonathan.druart, julian.maurice, kyle, m.de.rooy, nick, tomascohen
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:
Bug Depends on:    
Bug Blocks: 17477    
Attachments: Bug 17152: Do not copy value when duplicating a subfield
[SIGNED-OFF]Bug 17152: Do not copy value when duplicating a subfield
Bug 17152: (counter-patch)Do not copy value when duplicating a subfield
Bug 17152: (counter-patch)Do not copy value when duplicating a subfield
Bug 17152: (counter-patch)Do not copy value when duplicating a subfield
Bug 17152: Do not copy value when duplicating a subfield

Description Sophie MEYNIEUX 2016-08-19 14:25:25 UTC
When cataloguing, if you want to duplicate a subfield that is not empty, the new subfield is created with a copy of data in it.
This is not the case when you duplicate an whole field. The new one is created with subfields but without data in it.
Comment 1 Jonathan Druart 2016-08-23 17:25:42 UTC Comment hidden (obsolete)
Comment 2 Héctor Eduardo Castro Avalos 2016-08-29 20:49:32 UTC Comment hidden (obsolete)
Comment 3 Nick Clemens 2016-08-31 16:10:28 UTC
The value is no longer copied, but neither is the subfield code

Example:
I copy 260$b
I get a new blank 260$_ (though the field description states "Name of publisher, distributor, etc"

We should copy the subfield code but not the contents
Comment 4 Héctor Eduardo Castro Avalos 2016-08-31 19:32:47 UTC Comment hidden (obsolete)
Comment 5 Héctor Eduardo Castro Avalos 2016-08-31 19:36:00 UTC Comment hidden (obsolete)
Comment 6 Nick Clemens 2016-09-06 10:07:16 UTC Comment hidden (obsolete)
Comment 7 Jonathan Druart 2016-09-07 10:02:49 UTC
Created attachment 55276 [details] [review]
Bug 17152: Do not copy value when duplicating a subfield

When cataloguing, if you want to duplicate a subfield that is not
empty, the new subfield is created with a copy of data in it.
This is not the case when you duplicate an whole field. The new one is
created with subfields but without data in it.

Test plan:
Add or edit a bibliographic record
Fill a subfield
Duplicate the subfield
=> Without this patch the value of the input will be copied
=> With this patch the new input will be emptied

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 8 Kyle M Hall 2016-09-08 13:02:36 UTC
Pushed to master for 16.11, thanks Hector!
Comment 9 Frédéric Demians 2016-09-08 20:12:38 UTC
Pushed in 16.05. Will be in 16.05.04.
Comment 10 Julian Maurice 2016-09-16 08:33:18 UTC
Pushed to 3.22.x, will be in 3.22.11
Comment 11 Tomás Cohen Arazi 2016-10-20 14:25:02 UTC
Nick's comment still applies on master and 16.05. This patch broke subfield cloning. I opened bug 17477 with evidence of this.