On the page /node/11144/edit (which is a content profile node), the user account fields are loaded into the page. However, it's loading the account details of the wrong user.
In account_profile_form_alter, it does the following:
/* integration with account form */
if (is_numeric(arg(1)) && $user = user_load(arg(1))) { // activate only on edit page (not on registration page)
module_load_include('pages.inc', 'user');
$account_form = user_profile_form(array(), $user);
?>
arg(1) is the Node ID, not the ID of the user who owns that node.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | 999980.patch | 935 bytes | kenorb |
| #6 | 999980.patch | 1.01 KB | robert castelo |
| #1 | 999980-account_profile-wrong-user.patch | 1.03 KB | mrfelton |
Comments
Comment #1
mrfelton commentedHere is a patch.
Comment #2
robert castelo commentedpatch above will break on account edit page, causing account fields not to display (Username, password,...).
Here's the code to fix issue on account edit page and content profile edit page. Will provide as a proper patch tomorrow:
Comment #3
kenorb commentedComment #4
kenorb commentedCould be related: #992894: Content profile node saved by anonymous
Comment #5
robert castelo commented#999980: Wrong user account data loaded has a knock on effect on #992894: Content profile node saved by anonymous because it gets the wrong user ID if on a profile edit page and then that gets used later on in the function.
Comment #6
robert castelo commentedpatch attached.
Comment #7
robert castelo commentedComment #8
kenorb commentedPatch against the latest git version.
Comment #9
kenorb commentedPatch makes sense.
Committed.
http://drupalcode.org/project/account_profile.git/commit/bf367e4
Thank you for your work.