When you switch "Change the name of the authoring user" to off in "/admin/settings/publishing_options" the uid of new nodes is always 0

Oliver

Original:

  if (user_access('administer nodes')) {
    // Populate the "authored by" field.
    if ($account = user_load(array('name' => $node->name))) {
      $node->uid = $account->uid;
    }
    else {
      $node->uid = 0;
    }
  }

Patch:

  if (user_access('administer nodes')) {
    // Populate the "authored by" field.
    if ($account = user_load(array('name' => $node->name))) {
	  if($account->uid > 0){
      	$node->uid = $account->uid;
	  }
	  else {
	  	$node->uid = $user->uid;
	  }
    }
    else {
      $node->uid = 0;
    }
  }
CommentFileSizeAuthor
node.module-D5.patch186 bytesohira

Comments

drumm’s picture

Status: Patch (to be ported) » Needs work

Please attach a unified diff. http://drupal.org/patch/create.

ohira’s picture

Version: 5.19 » 5.20
Priority: Critical » Normal
Status: Needs work » Active

Sorry, i can't do that.

Oliver

bradweikel’s picture

Status: Active » Postponed (maintainer needs more info)

"/admin/settings/publishing_options" is not a valid path in Drupal 5 core, and the phrase "Change the name of the authoring user" doesn't appear anywhere that I'm aware of.

Is there a contrib module involved? Google doesn't see it...

dpearcefl’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)

Considering the lack of activity on this issue and that Drupal v5 is no longer supported by for fixes or patches, I am going to close this ticket.

dpearcefl’s picture

Assigned: ohira » Unassigned