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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

webchick’s picture

Issue tags: +Fields in Core, +Novice

Oh 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.

Berdir’s picture

Ok, 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...

JuliaKM’s picture

Status: Needs review » Active
FileSize
514 bytes

Here'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.

JuliaKM’s picture

Status: Active » Needs review

Status: Active » Needs work

The last submitted patch failed testing.

JuliaKM’s picture

Status: Needs work » Needs review
FileSize
500 bytes

Please ignore the previous patch. Here's a new version that still needs a test.

Status: Needs review » Needs work

The last submitted patch failed testing.

webchick’s picture

Status: Needs work » Needs review

Oh, testing bot...

Status: Needs review » Needs work

The last submitted patch failed testing.

mfb’s picture

Status: Needs work » Closed (duplicate)
usaroch’s picture

Title: user_profile_form_validate() not called when submitting user_profile_form » i want to add terms of use and validations to registeration form
Version: 7.x-dev » 6.7
Assigned: Unassigned » usaroch
Category: bug » task
Status: Closed (duplicate) » Active

hi

i want to add terms of use and validations to registration form. its urgent can i one help me.

regards udit saroch

yched’s picture

Title: i want to add terms of use and validations to registeration form » user_profile_form_validate() not called when submitting user_profile_form
Version: 6.7 » 7.x-dev
Assigned: usaroch » Unassigned
Category: task » bug
Status: Active » Closed (duplicate)

Please 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.