I have replaced the username with first name and last name of profile field. Every thing is okay, but when I try to post a comment it gives me an error mentioning that the author name is not valid.

How can I get rid of this error? Any idea?

Thank you.

Comments

vm’s picture

you will need to be more verbose about what you did to change the default functionality. posting the code you changed and what you changed it to may help.

beautifulmind’s picture

I am using email registration module for logging in. By default Drupal strips off the string just before '@' in the email and treat it as username. Now I have created profile fields for user like first name, last name. I write a piece of code -- using hook_user to replace the username with the first name + last name.
Every thing works just fine except when I try to post a comment. It throws and error mentioning author name is not valid.

I hop this would be enough to understand what I am looking for.

Thank you.

Beautifulmind
Know more

Regards.
🪷 Beautifulmind

CleanCutRogue’s picture

Do you have a link? Can you paste your implementation of hook_user? Can you paste the error message you're getting?