From 6ed29bccef590a1bc5e4cea175b41b8024483320 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 8 Jul 2021 15:48:36 +0200 Subject: [PATCH] Bug 27526: Fix mandatory and important checks The input names have been changed from "field_value" to $kohafield. Modifying this could have an impact in other area, where CheckMandatorySubfields and CheckImportantSubfields are called. Using .input_marceditor let us fix the additem.tt form and prevent to break the other ones. Note that the other ones are actually broken (!) Also note that there is a typo in the error message alertString2 += "\n- " + "%s " + MSG_MANDATORY_FIELDS_EMPTY.format(total_errors); There is an extra %s Signed-off-by: Tomas Cohen Arazi Signed-off-by: Martin Renvoize Signed-off-by: Tomas Cohen Arazi Signed-off-by: Jonathan Druart --- koha-tmpl/intranet-tmpl/prog/js/cataloging.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/cataloging.js b/koha-tmpl/intranet-tmpl/prog/js/cataloging.js index b50e9fac44..f93fefc833 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/cataloging.js +++ b/koha-tmpl/intranet-tmpl/prog/js/cataloging.js @@ -557,7 +557,7 @@ function CloneItemSubfield(original){ function CheckMandatorySubfields(p){ var total = 0; $(p).find(".subfield_line input[name='mandatory'][value='1']").each(function(){ - var editor = $(this).siblings("[name='field_value']"); + var editor = $(this).siblings(".input_marceditor"); if (!editor.val()) { editor.addClass("missing"); total++; @@ -569,7 +569,7 @@ function CheckMandatorySubfields(p){ function CheckImportantSubfields(p){ var total = 0; $(p).find(".subfield_line input[name='important'][value='1']").each(function(i){ - var editor = $(this).siblings("[name='field_value']"); + var editor = $(this).siblings(".input_marceditor"); if (!editor.val()) { editor.addClass("missing"); total++; -- 2.39.5