Hello all, I'm surprised I haven't seen a bug about this, so I'm not 100% sure it's a bug, but I find the behavior inappropriate. When a field or subfield is linked to a list of authorised values (and therefore a select) and is repeatable, the selected value from the select is repeated in the clone. It would be more appropriate to leave the field empty.
Created attachment 162376 [details] [review] 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
Created attachment 162421 [details] [review] 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
Created attachment 162430 [details] [review] 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>
Created attachment 162432 [details] [review] 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>
Pushed for 24.05! Well done everyone, thank you!
Looks like a bug. I backport Pushed to 23.11.x for 23.11.04
Backported to 23.05.x for upcoming 23.05.10