From 977b0e2708d889c6b891626a7efd787c3a74dd55 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Tue, 25 Aug 2020 11:26:31 +0000 Subject: [PATCH] Bug 11299: (follow-up) Skip fields with no 9 subfields To test: 1 - Disable the 'thesaurus' for a controlled field like 600a or 650a 2 - Edit a record and put random data in this field 3 - Try to link, get a JS error 4 - Apply patch 5 - Repeat 6 - No more error, field is not linked (as it has no $9 subfield) Signed-off-by: Michal Denar --- koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt index 5e4438daa5..e1b01a9706 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt @@ -264,6 +264,8 @@ function updateHeadingLinks(links) { // Find the $9 field to update var tag_subfield_line = $('.subfield_line[id^=subfield' + heading.tag + '9]').eq(tag_index); + if( tag_subfield_line.length < 1 ){ return; } + var subfield = tag_subfield_line.children('.input_marceditor').eq(0); // Delete the old status if one exists -- 2.11.0