Drupal 6.26

My setup for content profile is such that the content profile node is created on user registration. Autocreation of node revisions is set to true.
The problem is that the created node revision uid is 0 in the node_revisions table.
Later if you create other revision for the content profile the Revisions tab appears. But you cannot see the initial revision of the content profile.

The problem is that in core node_save() function the revision is created in the name of the current user. But on content profile creation the current user object does not have the uid yet.

The fix is simple:
content_profile-registration.module Line: 258:

      $node = node_submit($node);
	  
      //set the uid for the user object to create a revision 
	  global $user;
	  $anonimous = false;
	  if($user->uid == 0) {	  
	    $user->uid = $node->uid;
	    $anonimous = true;
	  }

      node_save($node);

     //set back the uid to 0 
	  if($anonimous) {
	    $user->uid = 0;
	  }