To recreate; 1. Set branch code as a PatronSelfRegistrationBorrowerMandatoryField 2. Go to the self reg form and look at the Home library field, it defaults to the first choice alphabetically 3. Fill out the other required fields and the captcha. Don't change the branchcode value. 4. Submit the form, it submits. 5. If branchcode is required it should default to an empty value and force the user to make a choice.
Created attachment 129016 [details] [review] Bug 29795: add empty value for branchcode on self-reg form 1. Set branch code as a PatronSelfRegistrationBorrowerMandatoryField 2. Go to the self reg form and look at the Home library field, it defaults to the first choice alphabetically 3. Fill out the other required fields and the captcha. Don't change the branchcode value. 4. Submit the form, it submits. 5. If branchcode is required it should default to an empty value and force the user to make a choice. 6. Apply patch 7. Repeat 1-3 8. Now you cannot submit the form unless you choose a branchcode 9. Make sure it still works normally when branchcode is not in PatronSelfRegistrationBorrowerMandatoryField
Created attachment 130236 [details] [review] Bug 29795: add empty value for branchcode on self-reg form 1. Set branch code as a PatronSelfRegistrationBorrowerMandatoryField 2. Go to the self reg form and look at the Home library field, it defaults to the first choice alphabetically 3. Fill out the other required fields and the captcha. Don't change the branchcode value. 4. Submit the form, it submits. 5. If branchcode is required it should default to an empty value and force the user to make a choice. 6. Apply patch 7. Repeat 1-3 8. Now you cannot submit the form unless you choose a branchcode 9. Make sure it still works normally when branchcode is not in PatronSelfRegistrationBorrowerMandatoryField Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Works as described, thanks for the patch!
Created attachment 130542 [details] [review] Bug 29795: add empty value for branchcode on self-reg form 1. Set branch code as a PatronSelfRegistrationBorrowerMandatoryField 2. Go to the self reg form and look at the Home library field, it defaults to the first choice alphabetically 3. Fill out the other required fields and the captcha. Don't change the branchcode value. 4. Submit the form, it submits. 5. If branchcode is required it should default to an empty value and force the user to make a choice. 6. Apply patch 7. Repeat 1-3 8. Now you cannot submit the form unless you choose a branchcode 9. Make sure it still works normally when branchcode is not in PatronSelfRegistrationBorrowerMandatoryField Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Makes sens. But why not adding this empty value when branchcode is not mandatory ? Is selecting first in list a way to have a default library ?
(In reply to Fridolin Somers from comment #5) > Makes sens. > > But why not adding this empty value when branchcode is not mandatory ? > Is selecting first in list a way to have a default library ? I see in staff interface library is mandatory and the first in list is selected. Should we also add an empty line ?
(In reply to Fridolin Somers from comment #5) > Makes sens. > > But why not adding this empty value when branchcode is not mandatory ? > Is selecting first in list a way to have a default library ? It is particularity important to have an empty value when the branchcode is mandatory or else it defaults to the first value alphabetically and the user can leave it on the first value and the form will submit. The problem with having the empty value when branchcode is NOT mandatory is the user can submit the form without a branchcode and that causes an error upon submission. There must be a branchcode.
So branchcode should always be in PatronSelfRegistrationBorrowerMandatoryField ?
(In reply to Fridolin Somers from comment #8) > So branchcode should always be in > PatronSelfRegistrationBorrowerMandatoryField ? It must be present on the form. It does not necessarily need to be mandatory but I suppose it could be.
OK, I've opened Bug 30151 for that
Pushed to master for 22.05, thanks to everybody involved [U+1F984]
Pushed to 21.11.x for 21.11.03
Pushed to 21.05.x for 21.05.12
Not backported to oldoldstable (20.11.x). Feel free to ask if it's needed.
*** Bug 27601 has been marked as a duplicate of this bug. ***