Hi all,

Pulling my hair out here :(

What I want to do:
I am looking for a way to change the all the user ids in all urls/paths to something else. Ideally it would be the user's username, but I would be content with just getting rid of the user id in paths alltogether.

Why:
I think by showing the user id to the user I am giving valuable private info about how many users there are ro might be.

What I have tried:
1) I installed Pathauto and thought that by just creating a pattern for user account page paths like so [user:name], it would solve my problem, and magically all the user IDs would change into the username.

For example, I have the normal user tabs in my user/account page:
View|Edit|Orders

And then I have added one more tab via a view - Purchased Files

So my user section looks like this:
View|Edit|Orders|Purchased Files
and the corresponding URLs are: user, user/3/edit, user/3/orders, user/3/files

So I thought that Pathouto would change these paths to: user, user/tommy/edit, user/tommy/orders, user/tommy/files

I thought it would just work, but I have found the following:
-The URL links from my tabs are still the old ones with the path user/3/orders for example
-If I try to navigate to user/tommy/edit for example I get the 'unauthorised' message, this is the same for all of them EXCEPT for user/tommy/files (the tab I created with views), which works at that URL, BUT the user tabs dissappear :|

2) Another problem now is that even If I uninstall Pathauto and clear my cache, this alias still exist at user/tommy/files - that seems very strange :|

3) I have tried so many other modules, Subpathauto, Me alias - but nothing seems to work.

SO NOW THE QUESTION IS:

Is there any way I can get rid of the User ID in my URLs with this module, AND have my site work as before and all links work and updated automatically?

Thanks alot, I love this module and use it quite a lot, I just can't seem to get it to play nice with the user id replacement.

Thanks!

Comments

Dave Reid’s picture

Priority: Major » Normal

Re #1: Pathauto only sets 'base' URL alias, so in your case user/[user:name]. You would leverage a module like Subpathauto for extending that alias into the sub-paths automatically, since realistically, for every path/tab user, you don't want N multiple aliases for each user, which clogs up the path alias system.

Re #2: I bet you have a contextual argument on your user/3/files view that accepts a user name as the argument and converts it into a user ID, which is why this still works even without the alias.

SGhosh’s picture

You could also use module - Extended path aliases. It works with Pathauto. Just install it and all your worries will be taken care of :)

SGhosh’s picture

Status: Active » Needs review

jackrowe - Please please review this.

Dave Reid’s picture

Status: Needs review » Active

No patch here, so please don't abuse the status field.