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

cubeinspire created an issue. See original summary.

manish.upadhyay’s picture

You 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.

manish.upadhyay’s picture

Status: Active » Needs review
SenthilMohith’s picture

Status: Needs review » Fixed

Hi 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.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.