[uid] Invalid token for nodes
venusrising - June 19, 2008 - 19:51
| Project: | Pathauto |
| Version: | 5.x-2.x-dev |
| Component: | Miscellaneous |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
Hello-
We are trying to get pathauto to work with advanced profile so we have a URL like:
.../users/user id (instead of /1 etc)
when we try to add the tokens under pathauto-node path settings-Pattern for all User Profile paths:
we tried users/[uid] but it came back as an invalid format. We were not sure if there are specific tokens only for this module?
Thanks for a great module!

#1
What does "it came back as an invalid format" mean?
Also, the "Assigned" field is for the person who is going to fix the issue so I assume you don't want that to be you.
#2
Hi Greggles- (I assume one of the lullabot team if I remember it right?)
Sorry about the assigned portion. In regard to path auto with advanced profile:
In pathauto under Pattern for all User Profile paths:
Replacement paths I added users/[uid] when I click save I get the message (in red error box)
You are using the token [uid] which is not valid within the scope of tokens where you are using it.
We would just like to have the userid in the URL as opposed to a numerical value i.e users/1 we would like users/greggles
Thanks for taking the time to help a Drupal novice.
PS The SEO screencasts are fantastic and much much appreciated as are the podcasts. They are really helping us a great deal here.
Thanks
#3
The UID _is_ the number so first off that doesn't make sense. It's probably erroring because there is no "uid" for a node. What you want is [author-name-raw].
Hopefully that fixes it for you. If not, please move it to the pathauto queue. Setting the auto path of a node has nothing to do with advprofile.
Michelle
#4
If you expand the "Node path settings" and then expand the "Replacement patterns" you will see that [uid] is not available for node paths. What you want is the [author-uid]
Michelle is mostly right, that author-* types of tokens are the right things for nodes. And she's also certainy right that this is not related to Advanced Profile.
On the side issues - I don't work for Lullabot, but I'm very glad that you enjoy the SEO screencasts.
Moving project and category since this isn't an advprofile problem.
#5
Thanks to both of you. Sorry for placing this within the wrong category. I was not sure if there were special tokens just for APK that I needed to be aware of.
#6
Hello-
I went in and amended the node path for Pattern for all User Profile paths: to [author-uid] I also tried users/[author-uid] and it still is producing the URL for admin (testing) as users/1.
I have done bulk upload and run cron.
I tried to search for pathauto docs but was not able to answer this issue with what I found.
Thanks you for your time.
#7
What is the label on the textfield where you are putting these tokens?
#8
APK doesn't do anything with tokens. I use pathauto to set the user/XX alias and it works just fine for me.
Michelle
#9
1. I was trying to place thus information under node path settings> Pattern for all User Profile paths:
2. When I went in and added user/[author-uid] Pattern for user account page paths it still does not generate the alias. Is it possible that this does not create an alias for user 1?
3. Under Pattern for user account page paths: I have left it at the default which is: users/[uid].
#10
#1 is irelevent. You're not trying to set the node path; you're trying to set the user path.
#2 makes no sense. user/[author-uid] isn't valid because there is no author of a user.
#3 users/[uid] will give you users/1 for an alias.
If you want users/joeschmo, put users/[user-raw] in the "Pattern for user account page paths".
Michelle
#11
I just found out the reason I was unable to get it to work was because Drupal had already created an alias for the admin user even though it was an exact duplicate. So I had to go in an delete the alias and then apply your suggestions and update and voila' we are in business. Thanks for all of your help and patience, you gave me a better understanding of how pathauto functions.
Cheers
#12
Great to hear that it's fixed and thanks @michelle for your responses.
#13
Automatically closed -- issue fixed for two weeks with no activity.