Cardnumber is lost if an invalid self registration form is submited to the server, and the server side form validation fails. I believe the idea is that the cardnumber should not be editable when requesting modifications to the borrower's details in the OPAC. But it would still make sense to keep the cardnumber field editable when correcting invalid form fields during self registration (also, see bug 17213). So, a simple fix is to let the cardnumber be editable if action != 'edit'. Test case * Enable the system preference PatronSelfRegistration * Make sure PatronSelfRegistrationBorrowerUnwantedField does not contain cardnumber. * Set the system preference GDPR_Policy to "Enforce". * In the OPAC click "Log in to your account" and "Register here". * Fill out the form with valid data, but make sure you leave the checkbox under "GDPR consent" unchecked. * Submit the form * You will get back the form with the error message "You have not filled out all required fields. Please fill in all missing fields and resubmit." * Without patch: cardnumber is not editable, and there is no input element for borrower_cardnumber (so the cardnumber will be lost when resubmitting the form) * With patch: cardnumber is editable.
Created attachment 124278 [details] [review] Bug 28930: Keep cardnumber be editable after server side form validation fails during self registration.
Created attachment 124320 [details] [review] Bug 28930: Keep cardnumber be editable after server side form validation fails during self registration. Test plan: - Enable the system preference PatronSelfRegistration - Make sure PatronSelfRegistrationBorrowerUnwantedField does not contain cardnumber. - Set the system preference GDPR_Policy to "Enforce". - In the OPAC click "Log in to your account" and "Register here". - Fill out the form with valid data, but make sure you leave the checkbox under "GDPR consent" unchecked. - Submit the form - You will get back the form with the error message "You have not filled out all required fields. Please fill in all missing fields and resubmit." - Without patch: cardnumber is not editable, and there is no input element for borrower_cardnumber (so the cardnumber will be lost when resubmitting the form) - With patch: cardnumber is editable. Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Created attachment 125665 [details] [review] Bug 28930: Keep cardnumber be editable after server side form validation fails during self registration. Test plan: - Enable the system preference PatronSelfRegistration - Make sure PatronSelfRegistrationBorrowerUnwantedField does not contain cardnumber. - Set the system preference GDPR_Policy to "Enforce". - In the OPAC click "Log in to your account" and "Register here". - Fill out the form with valid data, but make sure you leave the checkbox under "GDPR consent" unchecked. - Submit the form - You will get back the form with the error message "You have not filled out all required fields. Please fill in all missing fields and resubmit." - Without patch: cardnumber is not editable, and there is no input element for borrower_cardnumber (so the cardnumber will be lost when resubmitting the form) - With patch: cardnumber is editable. Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Passing QA. This bug was actually "Fixed" already by bug 28934 which was pushed just recently but this fixes the situation where a librarian changes the Opac registration form mandatory values after the patron doing the registration has already loaded the registration page. So if GDPR option became mandatory whilst the patron was inputting the registration info this fixes it now :)
Pushed to master for 21.11, thanks to everybody involved!
Pushed to 21.05.x for 21.05.05
Pushed to 20.11.x for 20.11.11
Not backported to oldoldstable (20.05.x). Feel free to ask if it's needed.