Volunteer: fix unsubscribe for users without email preference #26115
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Users who had volunteered before we added the email preference weren't able to modify subscription preferences because the server was enforcing a requirement that there be an email preference.
This adds the email preference dropdown to the "Update email preferences" UI.
It's not mandatory if the user already has an email preference, but if they don't, submitting the form will give an error that a value needs to be provided.
(Also, the red asterisk next to email preference is only shown if we don't already have one on record.)
This is similar to the 18+ fix made in #14622.
Also made a couple small fixes to
/volunteer/local
: when contacting a volunteer, the initiating user'sage_18_plus_b
value is now written properly in theVolunteerContact2015
form, and fields highlighted for errors are returned to normal when the form is submitted successfully.