Bug 29795 - If branch is mandatory on patron self registration form, the pull down should default to empty
Summary: If branch is mandatory on patron self registration form, the pull down should...
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: master
Hardware: All All
: P5 - low minor (vote)
Assignee: Lucas Gass
QA Contact: Testopia
URL:
Keywords:
: 27601 (view as bug list)
Depends on:
Blocks: 30151 27601
  Show dependency treegraph
 
Reported: 2022-01-04 22:32 UTC by Lucas Gass
Modified: 2023-01-23 23:13 UTC (History)
7 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Creates an empty value and defaults to it when PatronSelfRegistrationBorrowerMandatoryField includes branchcode. This forces self registering users to make a choice for the library.
Version(s) released in:
22.05.00,21.11.03,21.05.13


Attachments
Bug 29795: add empty value for branchcode on self-reg form (2.16 KB, patch)
2022-01-04 22:48 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 29795: add empty value for branchcode on self-reg form (2.23 KB, patch)
2022-02-07 15:26 UTC, Biblibre Sandboxes
Details | Diff | Splinter Review
Bug 29795: add empty value for branchcode on self-reg form (2.28 KB, patch)
2022-02-13 14:55 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Lucas Gass 2022-01-04 22:32:24 UTC
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.
Comment 1 Lucas Gass 2022-01-04 22:48:04 UTC
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
Comment 2 Biblibre Sandboxes 2022-02-07 15:26:09 UTC
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>
Comment 3 Sally 2022-02-07 15:26:57 UTC
Works as described, thanks for the patch!
Comment 4 Katrin Fischer 2022-02-13 14:55:39 UTC
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>
Comment 5 Fridolin Somers 2022-02-16 21:45:46 UTC
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 ?
Comment 6 Fridolin Somers 2022-02-16 21:50:40 UTC
(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 ?
Comment 7 Lucas Gass 2022-02-16 21:54:41 UTC
(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.
Comment 8 Fridolin Somers 2022-02-16 21:58:31 UTC
So branchcode should always be in PatronSelfRegistrationBorrowerMandatoryField ?
Comment 9 Lucas Gass 2022-02-16 22:04:30 UTC
(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.
Comment 10 Fridolin Somers 2022-02-22 00:15:57 UTC
OK, I've opened Bug 30151 for that
Comment 11 Fridolin Somers 2022-02-22 01:14:18 UTC
Pushed to master for 22.05, thanks to everybody involved 🦄
Comment 12 Kyle M Hall 2022-03-04 11:59:59 UTC
Pushed to 21.11.x for 21.11.03
Comment 13 Andrew Fuerste-Henry 2022-03-07 20:15:24 UTC
Pushed to 21.05.x for 21.05.12
Comment 14 Victor Grousset/tuxayo 2022-03-18 02:37:30 UTC
Not backported to oldoldstable (20.11.x). Feel free to ask if it's needed.
Comment 15 Katrin Fischer 2023-01-23 23:13:22 UTC
*** Bug 27601 has been marked as a duplicate of this bug. ***