function content_profile_page_edit($type, $account) {
....
if (!$node) {
$node = array('uid' => $account->uid, 'name' => (isset($account->name) ? $account->name : ''), 'type' => $type, 'language' => '');
}
function node_object_prepare(&$node) {
...
if (!isset($node->nid)) {
...
$node->uid = $user->uid; // eeeekkkkkkkk
$node->created = time();
http://api.drupal.org/api/function/node_object_prepare/6
I have a sinking feeling this is a duplicate but couldn't find it, sorry if that's the case.
Patch resets the uid based on name in prepare.
Comments
Comment #1
hefox commentedRight, if statement above will sometimes invalidate if statement below.
Comment #2
hefox commentedUpdated patch, haven't tested other than passing validation, but using similar code elsewhere.
Comment #3
YK85 commentedsubscribing
Comment #4
hefox commentedThat user_load should likely be
user_load isn't cached.
However, the patch is still valid, it could benefit more from being reviewed.
Comment #5
YK85 commentedThe patch worked great =)
Anyone else able to review?
Comment #6
vkareh commentedI found that I also needed to set the form value for name and uid during form alter, depending on how you are passing the other user's uid in the URL.
I guess that also has to do with the fact that there are different URLs for the same thing in this module. I attached a patch that includes my additions as well.