Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi all!
I think my head will explode in the near future :D I can't solve the following problem. Who can help me out?
Users on my site can only create 1 node. The username is used as nodetitle (with automatic nodetitle pattern).
But, when a user changes his username the nodetitle is not automatically changing to that new username. It changes only when the node is updated...but that's not what I want. I want the username AND the title of his/her node always be the same. Directly when the username has changed.
How can I manage this?
Kind regards,
Benjamin
Comments
Comment #1
hiramanpatil CreditAttribution: hiramanpatil commentedAs you said 'Users on my site can only create 1 node' then you can write custom code in hook_user_update to update the node title with updated username where uid is equal to logged in user id.
Thanks
Comment #2
gaurav.kapoor CreditAttribution: gaurav.kapoor at OpenSense Labs for DrupalFit commentedComment #3
gaurav.kapoor CreditAttribution: gaurav.kapoor at OpenSense Labs for DrupalFit commented