From c18d62e71d66387f0199e09e4b367f4a09f39f8b Mon Sep 17 00:00:00 2001 From: Emmi Takkinen Date: Thu, 12 Feb 2026 09:37:15 +0200 Subject: [PATCH] Bug 41829: Set correct id to copied Tag editor button When one copies MARC field, Tag editor button on fields containing value builder plugin have same id as original MARC field. This patch sets correct id to these buttons. To reproduce: 1. Find MARC framework which has value builder plugin attached to one of its fields. 2. Navigate to Cataloging -> New record. 3. Navigate to MARC field with plugin attached to it. 4. Inspect fields Tag editor button with browsers developer tools. -> Check the id of Tag editor button. 5. Copy the field and check id of copied Tag editor button. -> Notice that it has the same id as in original field. 6. Apply this patch. 7. Referesh the page, navigate back to field and copy it. 8. Inspect Tag editors id. -> Id should now be same as in other copied fields. Sponsored-by: Koha-Suomi Oy Signed-off-by: Owen Leonard Signed-off-by: Laura_Escamilla Signed-off-by: Lucas Gass (cherry picked from commit c28b9b86ca6ef78d70c692d3740d1110b3dc7f6c) Signed-off-by: Baptiste Wojtkowski --- koha-tmpl/intranet-tmpl/prog/js/cataloging.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/cataloging.js b/koha-tmpl/intranet-tmpl/prog/js/cataloging.js index 39bcf6f150..f33f716164 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/cataloging.js +++ b/koha-tmpl/intranet-tmpl/prog/js/cataloging.js @@ -330,7 +330,7 @@ function CloneField(index, hideMarc, advancedMARCEditor) { // do nothing if label does not exist. } - // setting its '+' and '-' buttons + // setting its '+', '-' and 'buttonDot' buttons try { var anchors = divs[i].getElementsByTagName("a"); for (var j = 0; j < anchors.length; j++) { @@ -352,6 +352,13 @@ function CloneField(index, hideMarc, advancedMARCEditor) { divs[i].getAttribute("id") + "'); return false;" ); + } else if ( + anchors[j].getAttribute("id").match(/^buttonDot/) + ) { + anchors[j].setAttribute( + "id", + anchors[j].getAttribute("id") + new_key + ); } } } catch (e) {