- Issue created by @mandclu
- Issue was unassigned.
- Status changed to Needs review
3 months ago 12:08pm 12 September 2024 - Status changed to Needs work
3 months ago 10:59pm 12 September 2024 - πΊπΈUnited States john.oltman
Makes sense, thanks @mandclu! One concern is existing installs that rely on having the State field displayed even if it can't be changed, especially when an existing registration is being edited by an admin (uses the same RegisterForm as a new registration). I also think when hiding the field on an existing registration, it should set the value using the value of the registration state and not the one state in the states array, otherwise the state could unwittingly change without the admin knowing.
To address existing installs, an idea is add a field to the Workflow settings at /admin/config/workflow/workflows/manage/registration, it would be labelled "Single State Form Handling" with help text "Indicate how the registration state field should be handled when only one state is configured to be shown on the registration form" and possible values "Hide the State field" and "Show the State field", with "hide" being the default. We would then have a hook_update_nn set the value to "show" for existing sites and workflows. This way existing installs experience no change, and new sites hide it - we can mention in the release notes so existing sites can edit the workflows if they want the new way of doing things.
We'll also eventually need some tests.
Would like your thoughts on my ideas above, setting to needs work while we work through this. - πΊπΈUnited States john.oltman
Going to proceed per my previous comment since no push back.
- πΊπΈUnited States john.oltman
Better idea is to add the show/hide setting to the form field widget, so each form display can be configured differently as needed.
- πΊπΈUnited States john.oltman
john.oltman β changed the visibility of the branch 3473817-hide-state-field-3.1 to hidden.
- Merge request !65Issue #3473817 by john.oltman, mandclu: Hide State field if only one option is available β (Merged) created by john.oltman
-
john.oltman β
committed f10662a1 on 3.1.x
Issue #3473817 by john.oltman, mandclu: Hide State field if only one...
-
john.oltman β
committed f10662a1 on 3.1.x
- Merge request !66Issue #3473817 by john.oltman, mandclu: Hide State field if only one option is available β (Merged) created by john.oltman
-
john.oltman β
committed 51881389 on 3.3.x
Issue #3473817 by john.oltman, mandclu: Hide State field if only one...
-
john.oltman β
committed 51881389 on 3.3.x
Automatically closed - issue fixed for 2 weeks with no activity.