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

--- Comment #7 from Frédéric Demians <[email protected]> ---
Created attachment 208343
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=208343&action=edit
Bug 43807: (follow-up) Don't enforce fields the patron form doesn't render

check_mandatory_fields() rejected patrons whose mandatory fields are not
rendered by the patron entry form, and so can never be filled from the
staff interface:

- for organisation (type I) categories, the fields that only apply to
  persons: title, firstname, preferred_name, middle_name, dateofbirth,
  initials and pronouns;
- the fields listed in BorrowerUnwantedField.

With firstname in BorrowerMandatoryField, an organisation patron could
not be created anymore.

This patch skips these fields. The fields rendered for organisations
(surname) and for persons (firstname...) remain mandatory. It fixes
the added unit tests.

It also fixes the tests of the first patch, which built a random
category: firstname isn't mandatory for organisations.

Test plan:
1. Apply the first two patches only (the tests).
2. prove t/db_dependent/Koha/Patron.t
   => FAIL: check_mandatory_fields() tests
3. Set BorrowerMandatoryField to surname|firstname|cardnumber.
4. Patrons > New patron > School (a type I category): fill the name and
   the card number, save.
   => The patron is not created: "The following mandatory fields are
      empty: firstname".
5. Apply this patch, restart_all.
6. Repeat step 2: the tests pass.
7. Repeat step 4: the patron is created.
8. Patrons > New patron > Patron (a type A category): leave the first
   name empty and check that it is still required.

-- 
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