https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34671

Emmi Takkinen <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #198691|0                           |1
        is obsolete|                            |
 Attachment #198692|0                           |1
        is obsolete|                            |
 Attachment #198693|0                           |1
        is obsolete|                            |
 Attachment #198694|0                           |1
        is obsolete|                            |
 Attachment #198695|0                           |1
        is obsolete|                            |
 Attachment #198696|0                           |1
        is obsolete|                            |

--- Comment #46 from Emmi Takkinen <[email protected]> ---
Created attachment 207285
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=207285&action=edit
Bug 34671: Show error message if fieldset has invalid input

If fieldset is collapsed and it contains required fields
patron can be saved without filling these fields. This patch
overwrites jQuery Validation plugins default ignore rule to
only ignore field with id "dateofbirth" (hidden by flatpicker)
and fields with new class "ignore_validation". New class is
always added for required fields that are hidden and removed
when they are visible. If user tries to save patron without
filling required fields in fieldset, error message is displayed.

To test with :
1. Make sure you have "Main address" fields set as mandatory
with BorrowerMandatoryField syspref (address, city, zipcode).
2. Add new patron, fill in some info, but leave "Main address"
fields empty.
3. Attempt to save.
=> "This field is mandatory" should be displayed next to the
address fields.
4. Collapse "Main address" fieldset.
5. Attempt to save again.
=> Patron is saved successfully without address information.
6. Apply this patch.
7. Edit patron and attempt to save again with "Main address"
fieldset collapsed.
=> Error message "There are some required fields missing from this
section. Please complete them." should be displayed and patron
isn't saved.
8. Fill missing fields, attempt to save.
=> Saving should now be successful.

To test with mandatory patron attributes:
1. Add new category A.
2. Add new category B.
3. Add new patron attribute type C, add "Staff interface mandatory",
apply to category A.
4. Add new patron category B.
5. Fill in the mandatory fields.
6. Change patron category from B to A, field for attribute C appear.
=> Confirm field is marked as required.
7. Leave field for attribute C blank and attempt to save patron.
=> Confirm that error message "There are some required fields missing.."
is displayed and patron isn't saved.
8. Fill attribute C and attempt to save patron again.
=> Saving should now be successful.

Sponsored-by: Koha-Suomi Oy

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to