Download & Extend

user_profile_form_validate() not called when submitting user_profile_form

Project:Drupal core
Version:7.x-dev
Component:user system
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed (duplicate)
Issue tags:Fields in Core, Novice

Issue Summary

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.

Comments

#1

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.

#2

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

#3

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.

AttachmentSizeStatusTest resultOperations
validate_profile_549726.patch514 bytesIdleFailed: 12203 passes, 0 fails, 6 exceptionsView details | Re-test

#4

Status:active» needs review

#5

Status:needs review» needs work

The last submitted patch failed testing.

#7

Status:needs work» needs review

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

AttachmentSizeStatusTest resultOperations
validate_profile_549726_v2.patch500 bytesIdleFailed: 12153 passes, 2 fails, 0 exceptionsView details | Re-test

#8

Status:needs review» needs work

The last submitted patch failed testing.

#9

Status:needs work» needs review

Oh, testing bot...

#10

Status:needs review» needs work

The last submitted patch failed testing.

#11

Status:needs work» closed (duplicate)

Duplicate of #239676: SA-CORE-2009-001: Missing validation for hook_user

#12

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
Category:bug report» task
Assigned to:Anonymous» usaroch
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

#13

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
Category:task» bug report
Assigned to:usaroch» Anonymous
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.