Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
user_profile_form_validate() is not called when submitting user/1/edit (user_profile_form).
Only user_validate_picture() is run.
This notably skips Field API validation.
Comment | File | Size | Author |
---|---|---|---|
#7 | validate_profile_549726_v2.patch | 500 bytes | JuliaKM |
#3 | validate_profile_549726.patch | 514 bytes | JuliaKM |
Comments
Comment #1
webchickOh yes please. Let's fix this because I keep mistakenly thinking that fields aren't working when it's just users.
Based on yched's description, this sounds like a one-liner, so tentatively marking as a Novice patch.
Comment #2
BerdirOk, I don't have time to roll a patch, but the change should be simple:
in user_edit_form, we add "$form['#validate'][] = 'user_validate_picture';". Because there is now a #validate function defined, the default $form_id_validate is not used anymore and needs to be added manually.
To fix this, just add "$form['#validate'][] = 'user_profile_form_validate';" in user_profile_form(). Also, a test would be great...
Comment #3
JuliaKM CreditAttribution: JuliaKM commentedHere's a first stab at a patch. This patch doesn't include a test because I wasn't sure what the test needs to do.
Comment #4
JuliaKM CreditAttribution: JuliaKM commentedComment #7
JuliaKM CreditAttribution: JuliaKM commentedPlease ignore the previous patch. Here's a new version that still needs a test.
Comment #9
webchickOh, testing bot...
Comment #11
mfbDuplicate of #239676: SA-CORE-2009-001: Missing validation for hook_user
Comment #12
usaroch CreditAttribution: usaroch commentedhi
i want to add terms of use and validations to registration form. its urgent can i one help me.
regards udit saroch
Comment #13
yched CreditAttribution: yched commentedPlease don't reopen issues fixed and closed 1 year ago for a semi related feature request on a different core version. This is issue hijacking and confuses the hell out of everyone. This is not how the issue queue works. Please open a new issue instead.
+ assigning an issue to yourself means that you intend to work on resolving it yourself.