Bugzilla – Attachment 150830 Details for
Bug 33648
Errors when enabling ERM in 22.11
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33684: Make mandatory date fields required when editing a patron
Bug-33684-Make-mandatory-date-fields-required-when.patch (text/plain), 1.95 KB, created by
Katrin Fischer
on 2023-05-09 09:44:02 UTC
(
hide
)
Description:
Bug 33684: Make mandatory date fields required when editing a patron
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2023-05-09 09:44:02 UTC
Size:
1.95 KB
patch
obsolete
>From 5c4db09759164acf324d382a95bf2b617ba6d476 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 9 May 2023 10:11:19 +0200 >Subject: [PATCH] Bug 33684: Make mandatory date fields required when editing a > patron > >Date fields in BorrowerMandatoryField are not required by the validation >form when a new patron is added or modified. > >This is because the 'required' prop does not exist on the input element >when the flatpickr instance is created. >We should either add it in the DOM directly (tt), but it will require to >do it "manually" for each date fields, or add it when we add it to the >inputs. This patch implements the second option. > >Test plan: >1. Add "dateofbirth" to syspref BorrowerMandatoryField. >2. Add patron and leave date of birth input field empty. >3. Save. >=> Form is not submitted and you are asked to fill in a date of birth > >Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi> >Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> > >https://bugs.koha-community.org/show_bug.cgi?id=33648 >--- > koha-tmpl/intranet-tmpl/prog/js/members.js | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/members.js b/koha-tmpl/intranet-tmpl/prog/js/members.js >index 597bb5d141..dad7ead3a3 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/members.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/members.js >@@ -190,7 +190,11 @@ $(document).ready(function(){ > }); > var mandatory_fields = $("input[name='BorrowerMandatoryField']").val().split ('|'); > $(mandatory_fields).each(function(){ >- $("[name='"+this+"']").attr('required', 'required'); >+ let input = $("[name='"+this+"']") >+ if ( input.hasClass('flatpickr') ) { >+ $(input).siblings('.flatpickr_wrapper').find('input.flatpickr').prop('required', true) >+ } >+ input.prop('required', true); > }); > > $("fieldset.rows input, fieldset.rows select").addClass("noEnterSubmit"); >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 33648
:
150561
|
150830