Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
user system
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
7 Dec 2010 at 13:03 UTC
Updated:
25 Dec 2010 at 06:30 UTC
Jump to comment: Most recent file
The current user_validate_current_pass function uses the global $user instead of the user object in $form. This makes it harder to reuse the function than it should be.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 991340_user_validate_current_pass_2.patch | 5.92 KB | alexpott |
| #1 | 991340_user_validate_current_pass.patch | 5.9 KB | alexpott |
Comments
Comment #1
alexpottThe patch attached includes a dummy test module that has a custom form that uses user_validate_current_pass(). A test has been added to user.test that uses this form.
Comment #2
moshe weitzman commentedThe code fix looks good. Seems like lot of test code which I have not reviewed. I did notice a copy/paste snafu - "Tests that node access permissions are followed."
Comment #3
alexpottCopy/paste snafu fixed.
The test code is so large as the point is to be able to reuse the user_validate_current_pass() function. In order to prove that code changes work (and the current code doesn't) a dummy test module is needed to provide a custom form using the validate function.
Comment #4
moshe weitzman commentedOK, bug fixed.
Comment #5
damien tournoud commentedJust as a sanity check for everyone: the password confirmation widget only appears if the user being modified is also the current user, so
$GLOBALS['user']is the same as$form['#user']whenuser_validate_current_passis called.Comment #6
alexpottYep Damien you are correct... I think this fix is more about code consistency than bug fixing.
Comment #7
dries commentedCommitted to CVS HEAD. Thanks.
Comment #8
rfayThis seems to have broken HEAD: http://qa.drupal.org/head-status
The commit was http://drupal.org/cvs?commit=462778
It looks to me like the problem is that the two files in the user_form_test module (modules/user/tests/user_form_test.info and modules/user/tests/user_form_test.module) didn't get committed.
Comment #9
webchickAdded those two missing files. Hope that makes testbot happier.
Comment #10
rfaywebchick's replacement commit: http://drupal.org/cvs?commit=462852