I've found a bug on Pathauto for Drupal7
How to reproduce:
1. Created an extra field "full_name" on the user profile (Configuration >> People >> Account settings >> Manage fields)
2. I installed pathauto and created an alias pattern for all user's profiles with the token of the "full name" field:
u/[user:field_full_name]
3. On template I try to get the link to the profile using
$user_link = drupal_get_path_alias('user/' . $node->uid);
The link saved on $user_link leads to a 404 and it's like:
users/username
intead of:
u/sergio-garcia-fernandez
Any suggestion on where to check for this problem?
Comments
Comment #2
manish.upadhyay CreditAttribution: manish.upadhyay as a volunteer commentedYou have to update all path alias for existing users because they have old path alias that is why it leads to 404 page and you got the wrong url using this function.
Comment #3
manish.upadhyay CreditAttribution: manish.upadhyay as a volunteer commentedComment #4
SenthilMohith CreditAttribution: SenthilMohith as a volunteer and at Innoppl Technologies Pvt. Ltd commentedHi cubeinspire,
You must delete the old alias for all the existing users path then update the new alias via bulk update (http://example.com/admin/config/search/path/update_bulk). After, you will get a new url like u/sergio-garcia-fernandez.