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

--- Comment #10 from Lisette Scheer <[email protected]> ---
Created attachment 210751
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210751&action=edit
Bug 43710: Check ExtendedPatronAttributes before saving self-registration
attributes

When ExtendedPatronAttributes is disabled, the OPAC self-registration
form does not show the patron attributes, so none are submitted. But
opac-memberentry.pl still called $patron->extended_attributes() with
the empty list, and its check of the mandatory attribute types does not
look at that preference. If a patron attribute type is mandatory and
editable in the OPAC, the check throws
Koha::Exceptions::Patron::MissingMandatoryExtendedAttribute, which is
not caught, and the registration ends with an error 500 (the patron has
already been created at that point).

When ExtendedPatronAttributes is enabled, the attribute is shown and
submitted, even if empty, so the error does not happen.

This patch only saves the extended attributes when
ExtendedPatronAttributes is enabled, as members/memberentry.pl already
does in the staff interface.

Steps to follow:
1. Set the system preferences:
   - PatronSelfRegistration: Allow
   - PatronSelfRegistrationDefaultCategory: any category (for example PT)
   - PatronSelfRegistrationVerifyByEmail: Don't require
2. Administration > Patron attribute types: add a type with
   "Mandatory" and "Editable in OPAC" checked.
3. Set ExtendedPatronAttributes to "Don't enable" and restart_all (the
   preference is cached).
4. OPAC > Create an account: fill in the form and submit it. There is
   an error 500, and the log shows
   Koha::Exceptions::Patron::MissingMandatoryExtendedAttribute.
5. Apply the patch and restart_all.
6. Repeat step 4: the registration is completed.
7. Set ExtendedPatronAttributes to "Enable", restart_all and register
   another patron: the attribute is shown in the form, and it is saved
   when a value is entered (check it in the patron details in the staff
   interface).

Signed-off-by: Adolfo Rodríguez <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: David Nind <[email protected]>
Signed-off-by: Lisette Scheer <[email protected]>

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