I'm using pathauto to username paths (/member/[username]). After changing a username the url alias doesn't change and the user edit page doesn't have an option to change it manually.
Is it possible to change it with a rule?
Drupal Answers is a question and answer site for Drupal developers and administrators. It only takes a minute to sign up.
Sign up to join this communityI'm using pathauto to username paths (/member/[username]). After changing a username the url alias doesn't change and the user edit page doesn't have an option to change it manually.
Is it possible to change it with a rule?
Yes, you should be able to do this with a rule. Something like the following:
Hope this helps!
Rules export:
{ "rules_change_user_url_alias" : {
"LABEL" : "Change user URL alias",
"PLUGIN" : "reaction rule",
"REQUIRES" : [ "rules", "path" ],
"ON" : [ "user_update" ],
"IF" : [
{ "NOT data_is" : { "data" : [ "account-unchanged:name" ], "value" : [ "account:name" ] } }
],
"DO" : [
{ "path_alias" : { "source" : "user\/[account:uid]", "alias" : "member\/[account:name]" } }
]
}
}