Unable to change author name on comment

Events happening in the community are now at Drupal community events on www.drupal.org.
firesidelibrarian's picture

In moving a website to Drupal &, we hired someone to copy & paste comments into the new site. Unfortunately, all names were left off, resulting in all comments being authored by "anonymous". When I try to edit the name, I get the error message, "You have to specify a valid author."

Is there a way to circumvent this restriction temporarily? I have over 700 comments to correct.

Thanks in advance for your assistance!
FSL

Comments

Change comment author

sher1's picture

Drupal requires that each author be a user in the system. You could use this
https://www.drupal.org/project/user_import with a csv. Then you could create a mysql table with the old users id that will hopefully be able to match up with the users name in the drupal users table and you could update the comments in bulk.

user_import idea

firesidelibrarian's picture

Thanks for the suggestion sher1 !

The people who have input comments are not site users, however. The site does not require membership to comment, as it is moderated.
If I add them, can I just set them to be 'blocked', and still have it work?
Or is there another workaround?

Thanks in advance!

Another option

xjm's picture

You could add a field to the comment for the "author" name for anonymous commenters, and make the actual author for all these comments Anonymous.

Also a good option

sher1's picture

This would also work. And would allow you to not create users or need to associate them with comments. You could just add the field to comments and populate it.
Here is a walk through for doing this
http://kps3.com/adding-new-fields-to-comments-in-drupal-7/

Comments' authors already "Anonymous"

firesidelibrarian's picture

Thanks, for the suggestion, xjm.

The comments that have been manually entered (transferred from an old site to this one by temp help) were entered as 'anonymous'. But the originals had names with them. When I try to edit them, the system won't let me. I am trying to find a workaround that will let me just correct the name somehow. Otherwise I wil have to delete the old and recreate them.

Right, I'm saying leave the

xjm's picture

Right, I'm saying leave the authors as 'Anonymous', and add a separate field to your comments for "Name" or something. Then you can import the name data from your old site to your new comment field.

this is the right way

sher1's picture

You should totally do what XJM is suggesting. If you can figure out which comment goes with which "user" name, you can copy the data from one field to the new comment field with a sql update.

Options

sher1's picture

Yes, you can set them to blocked but all of the new comments will be attributed to anonymous. The other option would be to require accounts to comment but only allow that privilege. You can still moderate comments but it would associate comments with specific people

The problem being described

playful's picture

The problem being described here is actually a bug. User permissions can be set so that site visitors without registered user accounts can leave comments. However, when editing a comment, site administrators are not allowed to changed the "Authored by" name to a non-registered user. I also am in the process of transferring comments to a Drupal 7 site and have encountered this problem. I do not want to define any new fields for the comments. Once the transfer is complete, I want to rely on the unaltered Drupal 7 comment system. Does anyone have a fix that addresses the underlying bug?

Thanks!

I had a similar problem. (I

jboyette36's picture

I had a similar problem. (I have the content type set to require contact information for anonymous users.) For me, as long as I specify an email address along with a name, the form will validate even if the name is not an existing Drupal user.

Since I searched vainly for a solution for a while and only found this comment that mostly described what I was encountering, I thought this might help future searchers.

I believe this is not a bug

joleenshook's picture

At least in Drupal 7, the author is the "owner" of the content. So it needs to be a user in the system, otherwise it borks the whole permissions system. So yes, the only way to accomplish what you're asking for is to either create another field to hold the commenter's name for anonymous users, or to create accounts for all of those people.

Wisconsin

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: