Bugzilla – Attachment 162432 Details for
Bug 36156
Don't duplicate selected value when a field or subfield linked to an authorized value is repeated
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36156: None value selected on clone field/subfield linked to AV
Bug-36156-None-value-selected-on-clone-fieldsubfie.patch (text/plain), 2.15 KB, created by
Pedro Amorim
on 2024-02-26 12:41:13 UTC
(
hide
)
Description:
Bug 36156: None value selected on clone field/subfield linked to AV
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2024-02-26 12:41:13 UTC
Size:
2.15 KB
patch
obsolete
>From 255f818ac3c5119cb52fcbb733c3c2d2361e3d8f Mon Sep 17 00:00:00 2001 >From: Thibaud Guillot <thibaud.guillot@biblibre.com> >Date: Fri, 23 Feb 2024 13:12:42 +0100 >Subject: [PATCH] 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> >--- > koha-tmpl/intranet-tmpl/prog/js/cataloging.js | 2 ++ > 1 file changed, 2 insertions(+) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/cataloging.js b/koha-tmpl/intranet-tmpl/prog/js/cataloging.js >index 01c9bcfe99a..5bd1841896d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/cataloging.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/cataloging.js >@@ -218,6 +218,7 @@ function CloneField(index, hideMarc, advancedMARCEditor) { > id_input = selects[0].getAttribute('id')+new_key; > selects[0].setAttribute('id',id_input); > selects[0].setAttribute('name',selects[0].getAttribute('name')+new_key); >+ selects[0].selectedIndex = -1; > }catch(e2){ // it is a textarea if it s not a select or an input > var textareas = divs[i].getElementsByTagName('textarea'); > if( textareas.length > 0 ){ >@@ -377,6 +378,7 @@ function CloneSubfield(index, advancedMARCEditor){ > id_input = selects[i].getAttribute('id')+new_key; > selects[i].setAttribute('id',selects[i].getAttribute('id')+new_key); > selects[i].setAttribute('name',selects[i].getAttribute('name')+new_key); >+ selects[i].selectedIndex = -1; > linkid = id_input; > } > >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 36156
:
162376
|
162421
|
162430
| 162432