Bug 9759 - last subfield can be deleted
Summary: last subfield can be deleted
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: master
Hardware: All All
: P5 - low minor (vote)
Assignee: Fridolin Somers
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-07 10:54 UTC by Fridolin Somers
Modified: 2014-05-26 21:04 UTC (History)
3 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
Proposed patch (2.24 KB, patch)
2013-03-07 11:09 UTC, Fridolin Somers
Details | Diff | Splinter Review
Bug 9759: last subfield can be deleted (2.29 KB, patch)
2013-03-08 15:52 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 9759: last subfield can be deleted (2.38 KB, patch)
2013-03-29 13:24 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Fridolin Somers 2013-03-07 10:54:37 UTC
In authorities and biblios editors, a repeatable subfield can be deleted (small icon next to input).
Clone subfields are really deleted but last existing subfield is just set empty instead of deleted.
But when same field is repeated, the last subfield can be deleted. The code checks for existing subfields in all fields instead of in field of the deleting subfield.
Comment 1 Fridolin Somers 2013-03-07 11:09:59 UTC Comment hidden (obsolete)
Comment 2 Kyle M Hall 2013-03-08 15:52:26 UTC Comment hidden (obsolete)
Comment 3 Marcel de Rooy 2013-03-29 13:24:40 UTC
Created attachment 17028 [details] [review]
Bug 9759: last subfield can be deleted

In authorities and biblios editors, a repeatable subfield can be deleted (small icon next to input).
Clone subfields are really deleted but last existing subfield is just set empty instead of deleted.
But when same field is repeated, the last subfield can be deleted.

This patch corrects this, last subfield of a field, even repeated, can not be deleted.

Test plan :
- Edit a biblio
- Choose a repeatable field with a repeatable subfield : ie 600 and $x
- Edit 600, enter a text in $x : ie "subA"
- Clone $x
- Delete second $x
=> second $x is deleted
- Delete first $x
=> $x is not deleted but set empty
- Edit 600, enter a text in $x : ie "subA"
- Clone 600
- Edit second 600, enter a text in $x : ie "subB"
- Clone $x of second 600
- Delete second $x of second 600
=> second $x of second 600 is deleted
- Delete first $x of second 600
=> with this patch : first $x of second 600 is set empty
=> without this patch : first $x of second 600 is deleted, second 600 has no $x anymore
Perform same test plan on an authority.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 4 Marcel de Rooy 2013-03-29 13:25:23 UTC
QA Comment:
Works as advertised. Nothing to say.
Passed QA
Comment 5 Marcel de Rooy 2013-03-29 13:26:37 UTC
When testing, you may need to refresh (Ctrl+F5) for clearing the cached js.
Comment 6 Jared Camins-Esakov 2013-03-30 02:49:05 UTC
This patch has been pushed to master.
Comment 7 Chris Cormack 2013-04-24 10:18:22 UTC
Pushed to 3.10.x will be in 3.10.6