Bug 19503 - Duplicating a dropdown menu subfield yields an empty subfield tag
Summary: Duplicating a dropdown menu subfield yields an empty subfield tag
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: 16.05
Hardware: All All
: P5 - low major (vote)
Assignee: Andreas Roussos
QA Contact: Kyle M Hall
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-10-20 19:28 UTC by Andreas Roussos
Modified: 2019-06-27 09:24 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
screenshot of staff client showing the error (23.98 KB, image/png)
2017-10-20 19:28 UTC, Andreas Roussos
Details
Bug 19503: Duplicating a dropdown menu subfield yields an empty subfield tag (1.95 KB, patch)
2017-10-20 20:28 UTC, Andreas Roussos
Details | Diff | Splinter Review
Bug 19503: Duplicating a dropdown menu subfield yields an empty subfield tag (2.02 KB, patch)
2017-10-23 07:31 UTC, Simon Pouchol
Details | Diff | Splinter Review
Bug 19503: Duplicating a dropdown menu subfield yields an empty subfield tag (2.13 KB, patch)
2017-10-27 12:39 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Roussos 2017-10-20 19:28:46 UTC
Created attachment 68331 [details]
screenshot of staff client showing the error

[This is a follow-up from bug 17818 which referred to v3.22. Apparently, the
same problem exists in v16.05.17, so I'm creating a new bug report here.]

The problem is as follows:
When editing a record in the staff client, if you clone a repeatable dropdown
subfield the cloned subfield's tag is empty (see attached screenshot). If you
then save the record and re-open it, the cloned subfield is not shown at all.
And if you save the record once more, that subfield is gone for good :(

I've tested versions 16.11.12 and 17.05.04 and they seem unaffected by this,
so I'm filing this bug against 16.05.

If you try to reproduce this bug, please note that it's only the cloning of
dropdown menu subfields that is broken. Cloning of textarea subfields works
fine.

Setting severity to 'major' as per bug 17818 and bug 17477.
Comment 1 Andreas Roussos 2017-10-20 20:28:54 UTC
Created attachment 68333 [details] [review]
Bug 19503: Duplicating a dropdown menu subfield yields an empty subfield tag

While editing a record in the staff client, if you clone a repeatable
dropdown subfield the cloned subfield's tag is empty. This can result
in data loss if the record is saved, re-opened, and saved yet again.
This patch (originally written by Sophie MEYNIEUX for bug 17818) fixes that.

Test plan:
0) [PREREQUISITE] In your MARC framework (Home > Administration > MARC
   bibliographic framework) ensure that you have at least one subfield
   of a particular tag linked to an authorised value (e.g. in UNIMARC,
   tag 700 subfield 4 is 'Relator Code' and can be linked to CCODE for
   testing purposes). This is so that the relevant subfield will be a
   dropdown menu and not a textbox.
1) In the Staff Client, edit an existing record or create a new one.
   Then, try to clone any subfield that is a dropdown menu. Observe
   that the cloned subfield's tag is empty.
2) Apply the patch.
3) Hit CTRL-F5 in your browser (to ensure cataloging.js is re-loaded)
   and try to clone a dropdown menu subfield again. This time the tag
   is cloned as well.
Comment 2 Simon Pouchol 2017-10-23 07:31:17 UTC
Created attachment 68373 [details] [review]
Bug 19503: Duplicating a dropdown menu subfield yields an empty subfield tag

While editing a record in the staff client, if you clone a repeatable
dropdown subfield the cloned subfield's tag is empty. This can result
in data loss if the record is saved, re-opened, and saved yet again.
This patch (originally written by Sophie MEYNIEUX for bug 17818) fixes that.

Test plan:
0) [PREREQUISITE] In your MARC framework (Home > Administration > MARC
   bibliographic framework) ensure that you have at least one subfield
   of a particular tag linked to an authorised value (e.g. in UNIMARC,
   tag 700 subfield 4 is 'Relator Code' and can be linked to CCODE for
   testing purposes). This is so that the relevant subfield will be a
   dropdown menu and not a textbox.
1) In the Staff Client, edit an existing record or create a new one.
   Then, try to clone any subfield that is a dropdown menu. Observe
   that the cloned subfield's tag is empty.
2) Apply the patch.
3) Hit CTRL-F5 in your browser (to ensure cataloging.js is re-loaded)
   and try to clone a dropdown menu subfield again. This time the tag
   is cloned as well.

Working as intended.

Signed-off-by: Simon Pouchol <simon.pouchol@biblibre.com>
Comment 3 Kyle M Hall 2017-10-27 12:39:00 UTC
Created attachment 68686 [details] [review]
Bug 19503: Duplicating a dropdown menu subfield yields an empty subfield tag

While editing a record in the staff client, if you clone a repeatable
dropdown subfield the cloned subfield's tag is empty. This can result
in data loss if the record is saved, re-opened, and saved yet again.
This patch (originally written by Sophie MEYNIEUX for bug 17818) fixes that.

Test plan:
0) [PREREQUISITE] In your MARC framework (Home > Administration > MARC
   bibliographic framework) ensure that you have at least one subfield
   of a particular tag linked to an authorised value (e.g. in UNIMARC,
   tag 700 subfield 4 is 'Relator Code' and can be linked to CCODE for
   testing purposes). This is so that the relevant subfield will be a
   dropdown menu and not a textbox.
1) In the Staff Client, edit an existing record or create a new one.
   Then, try to clone any subfield that is a dropdown menu. Observe
   that the cloned subfield's tag is empty.
2) Apply the patch.
3) Hit CTRL-F5 in your browser (to ensure cataloging.js is re-loaded)
   and try to clone a dropdown menu subfield again. This time the tag
   is cloned as well.

Working as intended.

Signed-off-by: Simon Pouchol <simon.pouchol@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

https://bugs.koha-community.org/show_bug.cgi?id=16503
Comment 4 Jonathan Druart 2017-10-27 17:17:41 UTC
Pushed to master for 17.11, thanks to everybody involved!
Comment 5 Fridolin Somers 2017-11-20 13:32:38 UTC
Pushed to 17.05.x, will be in 17.05.06
Comment 6 Katrin Fischer 2017-11-21 21:50:53 UTC
>I've tested versions 16.11.12 and 17.05.04 and they seem unaffected by this,
so I'm filing this bug against 16.05.

Same here, everything appears to work as expected.