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
BenIPAQ CreditAttribution: BenIPAQ commentedComment #2
TR CreditAttribution: TR commentedWHEN a user is updated
IF the new user name is not the same as the old user name
THEN execute a Rules component to change the title of some node on your system
If your data module had an explicit relationship between the user and the node (other than the node title just happens to be the same as the user name), then this would be trivial. It's still easy, but what you have to do in the "Rules component" mentioned above is to use the entity_query action to find the node whose title is the same as the old user name, then alter the title of that node.
Comment #3
TR CreditAttribution: TR commented