From 24d8cf6cc88c7a1a8cc1ad3024c1f507aca550d7 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 6 Apr 2022 17:00:36 +0200 Subject: [PATCH] Bug 30376: Fix missing mandatory date acquired error on item save MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Johanna Raisa Signed-off-by: Joonas Kylmälä --- koha-tmpl/intranet-tmpl/prog/js/cataloging.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/koha-tmpl/intranet-tmpl/prog/js/cataloging.js b/koha-tmpl/intranet-tmpl/prog/js/cataloging.js index 5ba1e76714..16cf857496 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/cataloging.js +++ b/koha-tmpl/intranet-tmpl/prog/js/cataloging.js @@ -566,6 +566,9 @@ function CheckMandatorySubfields(p){ var total = 0; $(p).find(".subfield_line input[name='mandatory'][value='1']").each(function(){ var editor = $(this).siblings(".input_marceditor"); + if ( !editor.length ) { // Deal with date inputs + editor = $(this).siblings(".flatpickr_wrapper").find(".input_marceditor"); + } if (!editor.val()) { editor.addClass("missing"); total++; @@ -578,6 +581,9 @@ function CheckImportantSubfields(p){ var total = 0; $(p).find(".subfield_line input[name='important'][value='1']").each(function(i){ var editor = $(this).siblings(".input_marceditor"); + if ( !editor.length ) { // Deal with date inputs + editor = $(this).siblings(".flatpickr_wrapper").find(".input_marceditor"); + } if (!editor.val()) { editor.addClass("missing"); total++; -- 2.30.2