Bug 36156: None value selected on clone field/subfield linked to AV
authorThibaud Guillot <thibaud.guillot@biblibre.com>
Fri, 23 Feb 2024 12:12:42 +0000 (13:12 +0100)
committerFridolin Somers <fridolin.somers@biblibre.com>
Mon, 11 Mar 2024 09:14:33 +0000 (10:14 +0100)
commit4d7df951f3572ca7063f5bbd869618b29e6e8607
tree74dc28974675fd7e656ee2b39fd674c09ea8e648
parenta42bce58b21c32868057dc0a45dde7580efae8f9
Bug 36156: None value selected on clone field/subfield linked to AV

When a field or subfield is linked to a list of authorized values and cloned, the selected value is repeated in the clone. This is linked to the default behavior of Select2Utils, so I've added a precise index (-1) to ensure that no value is selected in the clone.

Test plan:

1) Create a repeatable field and subfield and link a list of authorised values to the subfield.
2) Edit a record, clone the field and see which value is automatically selected in the clone.
3) Apply the patch
4) Repeat step 2

Sponsored by : BibLibre

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit ed037fb2740418816b192abe06a250193ad05e40)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
koha-tmpl/intranet-tmpl/prog/js/cataloging.js