From 23fe5b60d2503b01a68d567ef24e66d9787402de Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 6 Apr 2022 17:00:36 +0200 Subject: [PATCH] Bug 30376: [ALTERNATIVE PATCH] Fix missing mandatory date acquired error on item save --- 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 5ba1e767146..16cf8574968 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.25.1