After upgrading to 1.0 all of my content submissions fail on first attempt because the RealName is put into the "Authored By" field. On submitting the form it tells me that the username does not exist. This is absolutely critical to me as my users register with an email address, not a user name, the user name is created automatically by the module, and therefore my users very likely will not even know their own user name in many cases.

Comments

Mr. Carpenter’s picture

I'm having a similar issue. Administrators on my site that have permission to change "Authored by" have to change it to their username every time they create a post.

To pauldawg: on my site this is not an issue unless the user has administer nodes permission.

pauldawg’s picture

I'll give it a try. Thanks for the tip!

TyraelTLK’s picture

I have the same problem.

jcwatson11’s picture

Mr. Carpenter's tip worked form me. But this is an obvious bug that administrators shouldn't have to deal with. How can it be fixed? It doesn't look like anyone is maintaining this module any more.

nancydru’s picture

Yes, the module is being maintained. Check my profile and see how many modules I have to maintain. Then think about my occasionally going on vacation...

If someone wants to help maintain this module, all they have to do is contact me. There is one person who has offered 6.x-only help, but I need someone who can do both versions. Meanwhile, patches will help a lot.

nancydru’s picture

Assigned: Unassigned » nancydru
Status: Active » Postponed (maintainer needs more info)

With the other changes I have committed, I am not seeing this. Please try the -dev version when it rolls up this evening. If the problem is gone, please mark this issue as "Fixed."

pauldawg’s picture

Looking forward to testing out the fix. Thanks!!

nancydru’s picture

Status: Postponed (maintainer needs more info) » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

typehost’s picture

Version: 6.x-1.0 » 5.x-1.x-dev
Status: Closed (fixed) » Active

I just upgraded to the 5.x-dev version of the module and still having the same error.

dade-1’s picture

This Bug is still alive in 6.x, too.

ianchan’s picture

FYI - in the settings for latest stable module there is a new tab labeled Bypass Forms. Adding these lines in the textarea allows RealNames to bypass the Authored by fields during node add/edit.

page_node_form author name
project_project_node_form author name

In my setup there is a problem with author name for the comment forms (even with comment_form name inserted to the textarea of Bypass Forms). However, I will post to a separate issue.

typehost’s picture

Thanks for that - I am using:

comment_form name
page_node_form author name
project_project_node_form author name
uprofile_node_form name

also uprofile_node_form author name

but still getting the "username does not exist - & - This field is disabled. You cannot alter the author of this entry from within the user area." error

downunder_al’s picture

I am also getting this problem - the comment form is using the realname data rather than the username, and hence it is impossible to comment, and I'm having the equivalent problem with all the other forms I use as well.

I am using the 6.x-1.x-dev version ( version id Version: $Id: realname.module,v 1.4.4.25 2008/11/30 20:36:15 nancyw Exp $ )

It's a shame, because this is a really useful module

coderintherye’s picture

Ok, so looks like the problem is we are passing $edit['author'] as the real name instead of as either the user->name or uid (not sure which it is supposed to be yet. This causes a fail in comment.module which sets off the error. Now, if we comment out lines 1385 - 1387 in comment.module (may vary depending on version):

  if (isset($edit['author']) && !$account = user_load(array('name' => $edit['author']))) {
    form_set_error('author', t('You have to specify a valid author.'));
  }

Then, we are able to post comments. Note, if you have the Show "Not verified" for anonymous users option checked, then it will show Not Verified next to all comment submitter names.

This of course is not the correct solution for solving this problem. We need to figure out how to pass $edit['author'] as the uid. $edit contains a uid property but this came up as blank when I printed it. Ok, so hopefully we can figure this out from here.

coderintherye’s picture

Ok so what we need is for Line 1521, where $edit['author'] is defined via $form['author'] we need the '#value' to be $user->realname_save instead of $user->name.

The original Line 1521, looks like this:
$form['author'] = array('#type' => 'value', '#value' => $user->name);

and I replaced it with the following lines:

	  if ($user->realname_save) {
	  $form['author'] = array('#type' => 'value', '#value' => $user->realname_save);
	  }
	  else {
      $form['author'] = array('#type' => 'value', '#value' => $user->name);
	  }

Again, this doesn't solve our problem, cause we don't want to hack comment.module, but now we know that we just need to switch our $form['author'] value to be $user->realname_save (which is the login username not the display/real name).

coderintherye’s picture

Solved, I think. It looks like the problem is at line 188
$form['author']['#default_value'] = $user->realname_save;

This needs to be changed to:

$form['author']['#value'] = $user->realname_save;

I'm fixing to go home so can't confirm to try this out on a clean install, but I will try later unless someone else can confirm.

nancydru’s picture

nancydru’s picture

@anarchman: If one uses #value, then it cannot be changed. I occasionally change the authored by info on my nodes. BTW, that code was for comments, not nodes. But that code is no longer in the module, so you apparently don't have the current -dev.

I am not seeing this problem on either 5.x or 6.x. Is it possible that some other module is messing around here?

nancydru’s picture

Status: Active » Postponed (maintainer needs more info)

I suspect that the fix to #321608: Username Overridden in Comments But ... is going to make this problem go away.

nancydru’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

No further update.