Bug 17725

Summary: Repeating a field or subfield clones content
Product: Koha Reporter: Katrin Fischer <katrin.fischer>
Component: CatalogingAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: major    
Priority: P5 - low CC: claire_gravely, jonathan.druart, josef.moravec, kyle, m.de.rooy, mtj
Version: unspecified   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17818
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on: 17817    
Bug Blocks:    
Attachments: Bug 17725: Do not copy subfield's content when cloning
Bug 17725: Same for textarea when cloning a field
[SIGNED-OFF] Bug 17725: Do not copy subfield's content when cloning
[SIGNED-OFF] Bug 17725: Same for textarea when cloning a field
Bug 17725: Do not copy subfield's content when cloning
Bug 17725: Same for textarea when cloning a field

Description Katrin Fischer 2016-12-05 22:42:46 UTC
To replicate:
- Open an existing record in your catalog
- Create another field or subfield of a field/subfield already used using the icon to repeat it
- Verify that the content is copied over
- Verify this happens for input (one line) and textare (multiple lines)

I can't make this happen for when creating a new record, but more consistently on editing existing records.

This is rather annoying when cataloguing in Koha, as the cataloguer has to empty the field first and that adds an extra step for each repeated field.
Comment 1 Jonathan Druart 2017-01-12 11:19:12 UTC
Created attachment 58867 [details] [review]
Bug 17725: Do not copy subfield's content when cloning

To replicate:
- Open an existing record in your catalog
- Create another field or subfield of a field/subfield already used using the icon to repeat it
- Verify that the content is copied over
- Verify this happens for input (one line) and textare (multiple lines)

I can't make this happen for when creating a new record, but more consistently on editing existing records.

This is rather annoying when cataloguing in Koha, as the cataloguer has to empty the field first and that adds an extra step for each repeated field.

Test plan:
Confirm than the content is not copied when you clone a field or a subfield.
Comment 2 Claire Gravely 2017-01-12 19:11:46 UTC
I have been unable to fully replicate the issue, but have found one occurance of an "input" field including content when copied.
I have successfully replicated the issue with texarea fields (multiple lines).

When testing I find the patch has fixed my single "input" field issue.

But the "textarea" field still includes content when cloned. Specifically this was 520 $a. Content is still copying across
Comment 3 Josef Moravec 2017-01-13 06:57:09 UTC
Yes there still remains last occurence of this bug - textareas when clonning whole field - typically 5xx in MARC21
Comment 4 Katrin Fischer 2017-01-13 07:11:20 UTC
Something that might be good to test: When an input field contains a lot of text, next time you open the record it will be shown as a textarea. The 5xx seem to always display as a textarea.
Comment 5 Jonathan Druart 2017-01-13 07:52:58 UTC
Created attachment 58914 [details] [review]
Bug 17725: Same for textarea when cloning a field
Comment 6 Jonathan Druart 2017-01-13 07:53:52 UTC
(In reply to Josef Moravec from comment #3)
> Yes there still remains last occurence of this bug - textareas when clonning
> whole field - typically 5xx in MARC21

Fixed!
Comment 7 Josef Moravec 2017-01-13 08:04:13 UTC
Created attachment 58915 [details] [review]
[SIGNED-OFF] Bug 17725: Do not copy subfield's content when cloning

To replicate:
- Open an existing record in your catalog
- Create another field or subfield of a field/subfield already used using the icon to repeat it
- Verify that the content is copied over
- Verify this happens for input (one line) and textare (multiple lines)

I can't make this happen for when creating a new record, but more consistently on editing existing records.

This is rather annoying when cataloguing in Koha, as the cataloguer has to empty the field first and that adds an extra step for each repeated field.

Test plan:
Confirm than the content is not copied when you clone a field or a subfield.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 8 Josef Moravec 2017-01-13 08:04:19 UTC
Created attachment 58916 [details] [review]
[SIGNED-OFF] Bug 17725: Same for textarea when cloning a field

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 9 Josef Moravec 2017-01-13 08:04:52 UTC
(In reply to Katrin Fischer from comment #4)
> Something that might be good to test: When an input field contains a lot of
> text, next time you open the record it will be shown as a textarea. The 5xx
> seem to always display as a textarea.

Tested, and looks fine
Comment 10 Katrin Fischer 2017-01-13 08:31:12 UTC
(In reply to Josef Moravec from comment #9)
> (In reply to Katrin Fischer from comment #4)
> > Something that might be good to test: When an input field contains a lot of
> > text, next time you open the record it will be shown as a textarea. The 5xx
> > seem to always display as a textarea.
> 
> Tested, and looks fine

Thx, Josef!
Comment 11 Nick Clemens (kidclamp) 2017-01-13 11:07:17 UTC
Created attachment 58944 [details] [review]
Bug 17725: Do not copy subfield's content when cloning

To replicate:
- Open an existing record in your catalog
- Create another field or subfield of a field/subfield already used using the icon to repeat it
- Verify that the content is copied over
- Verify this happens for input (one line) and textare (multiple lines)

I can't make this happen for when creating a new record, but more consistently on editing existing records.

This is rather annoying when cataloguing in Koha, as the cataloguer has to empty the field first and that adds an extra step for each repeated field.

Test plan:
Confirm than the content is not copied when you clone a field or a subfield.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 12 Nick Clemens (kidclamp) 2017-01-13 11:07:23 UTC
Created attachment 58945 [details] [review]
Bug 17725: Same for textarea when cloning a field

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 13 Kyle M Hall (khall) 2017-01-13 11:26:25 UTC
Pushed to master for 17.05, thanks Jonathan!
Comment 14 Katrin Fischer 2017-01-15 16:23:07 UTC
These patches have been pushed to 16.11.x and will be in 16.11.02.
.
Comment 15 Mason James 2017-01-25 00:30:16 UTC
Blocked by enhancement, skipping for 16.05.x