From 2f2e4ecb25be62db403ba39399058c5be8c49fef Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Mon, 9 Aug 2021 12:09:13 +0000 Subject: [PATCH] Bug 28828: Fix unimarc_field_4XX.tt and marc21_linking_section.tt value builders Find closest ul for value builders. Since Bug 22399 changes in biblio editor, value builder unimarc_field_4XX.tt JavaScript code does not do its job anymore. This is because a div is added and this call is now wrong: var subfields = whichfield.parentNode.parentNode.getElementsByTagName('input'); Test plan 1: 1) Use a UNIMARC DB 2) Define value builder unimarc_field_4XX on 463$t 3) Create a record B1 with 200$a, 200$f 4) Create a new record B2 5) Click on value builder in 463$t 6) Search for record B1 7) Click on "Choose" => Without patch only 463$t is filled with a value => With patch 463 $t, $a, $0 and $9 are filled with a value Test plan 2: 1) Use a MARC_21 DB 2) Define plugin marc21_linking_section.pl on 773$t 3) Make sure 773$t and other subfields are visible in intranet/editor 4) Create a new record in basic cataloging editor 5) Click on value builder in 773$t 6) Search fro a record 7) Click on "Choose" => Without patch fields are not fileld => With patch subfields are correctly filled Signed-off-by: Katrin Fischer Signed-off-by: David Nind Signed-off-by: Jonathan Druart --- .../cataloguing/value_builder/marc21_linking_section.tt | 3 +-- .../en/modules/cataloguing/value_builder/unimarc_field_4XX.tt | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_linking_section.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_linking_section.tt index 91852ed903..61746ccde9 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_linking_section.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_linking_section.tt @@ -139,8 +139,7 @@ } // browse all its subfields - - var subfields = whichfield.parentNode.parentNode.getElementsByTagName('input'); + var subfields = whichfield.closest('ul').getElementsByTagName('input'); var re = /^tag_\d*_code_/; for (var i = 0, len = subfields.length; i < len; i++) { diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_4XX.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_4XX.tt index 8f37e9143b..c45ca625f7 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_4XX.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_4XX.tt @@ -159,7 +159,7 @@ // browse all its subfields - var subfields = whichfield.parentNode.parentNode.getElementsByTagName('input'); + var subfields = whichfield.closest('ul').getElementsByTagName('input'); var re = /^tag_\d*_code_/; for(var i=0, len = subfields.length ; i< len ; i++) { -- 2.39.5