One is able to save patron without date of birth even if "dateofbirth" is set mandatory in syspref BorrowerMandatoryField. This doesn't seem to happen with other fields. To reproduce: 1. Add "dateofbirth" to syspref BorrowerMandatoryField. 2. Add patron and leave date of birth input field empty. 3. Save. => Patron is saved succesfully.
Tested this a bit and it seems that any field with flatpicker attached to it has this same problem, e.g. expiration date.
Created attachment 150823 [details] [review] 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
Created attachment 150826 [details] [review] 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>
Created attachment 150831 [details] [review] 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
Pushed to master for 23.05. Nice work everyone, thanks!
Nice work everyone! Pushed to stable for 22.11.x
Backported to 22.05.x for upcoming 22.05.14
Not backporting to 21.11.x