I searched the queue and couldn't find a discussion on this. I'd like to suggest we begin using aliasing of the /user/ URL to the same URL with the username.

ex.
http://drupal.org/user/58897
http://drupal.org/user/jredding
would be the same.

Motivation

  1. It's more human.
  2. It makes it easier to link to the drupal.org profile from subsite such as DrupalCon sites
  3. DA Memberships are currently pattern matching on the username string to define if a user has a membership or not
  4. Brings us another step closer to admitting we have a user profile problem. Too many profiles on too many subsites
  5. jredding should be jredding on every subsite, not 58897, 355, and 707
  6. Allows a D.O profile to become even more of a resume ala LinkedIN, Facebook, etc.
  7. It's more human.

Currently blocking problems

In order to achieve goal #2 of making it easier to link from a subsite to d.o profiles we would need to fix these:

  1. Usernames on drupal.org have duplicates that only differ by upper/lower case characters. Path aliases do not differentiate between upper/lower case. #1034852: Clean up accounts with case-insensitive duplicate names starts on this issue, but we would need to fix all existing names to really solve this problem.
  2. Pathauto will either transliterate non-ascii128 characters or remove them from the username. Drupal.org has a lot of users who have non-ascii128 characters in their names. I'm not sure what we would do to solve this problem.
  3. We would have to prevent someone from registering with a name that contains only numbers - e.g. a user named "1" would conflict with the actual user 1
  4. There is a scalability concern to adding 1,000,000 aliases that needs to be tested. This might not really be an issue but we'll know that from someone testing it. If it is an issue, one idea is to only give aliases to the "non-spammers" or maybe only if someone requests one somehow (an automatic process that requires no approval).

The introduction of aliases for usernames might make it harder to link from subsites to the main profile unless the standard user/uid format were used and a redirect module were added to go from user/UID to user/alias. Bakery currently provides a user's UID to the slave sites in the users.init field. In order to go from that to the aliased version of the name it would be necessary to somehow figure out the aliased version - that might be a webservice, copying down a database table, or actually storing everyone's alias on the master site in the subsite. Storing the alias would be a real pain since people can change their names and we'd have to copy it down.

Comments

drumm’s picture

Project: Drupal.org customizations » Drupal.org infrastructure
Version: 6.x-3.x-dev »
Component: User interface » Other

Project module for D7 will require pathauto, so we will be able to enable this with configuration. See also #1117436: Deploy pathauto & token for organization nodes?.

greggles’s picture

I think this needs a scalability review. Adding ~1,000,000 aliases might have an impact.

jredding’s picture

OK, great. We can postpone this until we figure out how to move forward with the upgrade.

The use of Pathauto will solve a few issues we have on a.d.o and integrating membership into drupal.org. Specifically it'll provide an easy method to link CiviCRM accounts back to their d.o account as we have d.o usernames but not IDs

greggles’s picture

If #3 is the only reason to do this it is worth considering closely. I assume CiviCRM has access to the Drupal $user object or users database table which does have the drupal.org UID in the users.init field.

killes@www.drop.org’s picture

Maybe we could limit this to people with the "not a spammer" role, ie trusted users. That would be less than 100k.

drumm’s picture

For association.drupal.org, we can go ahead and deploy pathauto without as much scalability review, it is a lot smaller of a site. We do need to ensure configuration for common parts, like username token pattern, are consistent across sites.

tvn’s picture

Don't we need to deal with duplicate names first #1034852: Clean up accounts with case-insensitive duplicate names?

jredding’s picture

@greggles @drumm The idea here is to use the name as the identifier instead of the ID. that is /jredding would become how I'm known instead of 58897. While we can solve the issue on a.d.o with some simple software the name is easier and more human. The problem on a.d.o is that a d.o user will come to a.d.o and be given a *new* ID, that ID is stored in CiviCRM and links to their a.d.o profile. We can easily back into the d.o ID by going from CiviCRM --> a.d.o ID --> d.o ID but due to bakery jredding is unique on a.d.o and in CiviCRM (As well as on DrupalCon sites) so it's easier to link back to someone's drupal.org profile.

In addition I believe this little change will get us thinking about moving towards a single profile for the entire *.drupal.org network (i.e. your a.d.o profile should be the same as your d.o profile)

killes@www.drop.org’s picture

I've never understood why people would need seperate profiles on all subsites.

greggles’s picture

Component: Other » association.drupal.org

If this is about association.d.o then it should be in that component. Is this just about that or also about drupal.org.

tvn raises a great point - we would also need to deal with duplicate names that differ only by case before this because aliases are case insensitive.

Separate profiles are a convenience for the d.o site builders/maintainers. If we could make them all one profile and still maintain the rich data of the subsites I'm sure we would do that but it takes more than a snap of fingers to make it happen.

jredding’s picture

Component: association.drupal.org » Other

@killes agreed

greggles’s picture

Component: Other » association.drupal.org

x post.

jredding’s picture

Component: association.drupal.org » Other

@greggles this is not about a.d.o, this is about d.o. Working on a.d.o just revealed the problem but my suggestion is about URLs on drupal.org being http://drupal.org/user/jredding instead of http://drupal.org/user/58897, this would help us quite a number of places including a.d.o. For example, when I sign up for DrupalCon via bakery then it is easy for us to link back to their drupal.org profile by using their d.o name instead of their ID (again, the ID is not difficult to obtain but the use of a name is much more human)

@greggles @tvn good point about the names, so this task would be dependent upon cleaning up that long-standing issue.

jredding’s picture

@greggles good point about the single profiles perhaps we should branch that discussion out to another issue and just focus on the use of pathauto for usernames right now.

drumm’s picture

Status: Active » Postponed (maintainer needs more info)

I think this is about Drupal.org. Stating #8 another way: Currently if you are on a CiviCRM contact page, you can click to the Association user profile, then click to the Drupal.org profile. It would be nice to be able to type in the drupal.org/user/… URL too.

(Another possibility in CiviCRM is to alter in a link to the Drupal.org profile on contact pages. The Drupal database has the needed info. This would be a separate issue.)

Marking as needs more info because we don't know if #1034852: Clean up accounts with case-insensitive duplicate names is a blocker. Can token/pathauto handle aliases which are different only by case? Do we even want to preserve username case-ing in the URL, or all lowercase? What about spaces and punctuation, are we good with the pathauto default settings?

greggles’s picture

If this is about drupal.org then what was the point of comment #6? Kind of a rhetorical question, but...yeah.

Can token/pathauto handle aliases which are different only by case?

tvn raises a great point - we would also need to deal with duplicate names that differ only by case before this because aliases are case insensitive.

greggles’s picture

And it's more than just #1034852, we would really need to not just deny but also fix any existing names.

Drave Robber’s picture

To make things worse, transliteration can cause additional conflicts, e.g http://drupal.org/user/68039 and http://drupal.org/user/2430896 would have the same alias.

jredding’s picture

@draveRobber doesn't pathauto assist with this by not allowing one alias to be overwritten by another one (i.e. first one to claim the alias wins, the second one gets something appended to it)

greggles’s picture

Issue summary: View changes

x

greggles’s picture

@jredding it does, but that doesn't matter in the case of being an easier way to link to people's profiles because you wouldn't be able to know, from association.d.o, whether to link to d.o/user/alina-0 or d.o/user/alina or d.o/user/alina-1

I've updated the issue summary to include some of the problems and potential solutions. It would be great if the "motivation" section could be fleshed out a bit - I'll admit that I don't really understand it.

greggles’s picture

Issue summary: View changes

x

jredding’s picture

@greggles Fair point but this can be fixed

1) When a new user signs up assign the alias then and there not allowing duplicate aliases and having the alias match the username. As usernames must be unique so to do the URLs

2) To fix old items we have the longstanding issue #1034852: Clean up accounts with case-insensitive duplicate names, which, when resolved, will clear this up.

3) Cleaning up duplicate usernames will require an amount of work but needs to be done regardless of this task

I am not advocating that this is an imperative or a priority. I initially filed to queue as I did not see a discussion about it and was looking for answers. However, I do think this would be a great addition to our site and start moving us along the path of central and standard profiles (obviously not necessary but definitely a human touch)

greggles’s picture

1. Seems reasonable. How do we handle existing people?
2. That issue is only about new users, not existing ones.
3. Agreed it will take a bit of work.

drumm’s picture

On #1034852: Clean up accounts with case-insensitive duplicate names, I'd been using that for both stopping new accounts and cleaning up old ones. The next step is stopping new problems; when that is done, I'd retitle it to fix up the old ones. That isn't very obvious from the issue, it would be okay to file a separare one for cleanup.

drumm’s picture

Issue summary: View changes

Updated the motivation section

jcnventura’s picture

Just to let you know that the grn module would also use this for good measure.

See #1319350: Create links to user/author.

tvn’s picture

Status: Postponed (maintainer needs more info) » Active

We'll be looking into this soon.
#1034852: Clean up accounts with case-insensitive duplicate names is the first step.

Oliver will start looking into other blockers and what it will take to fix them.

opdavies’s picture

Sorry if I'm repeating anything already said above:

Pathauto will either transliterate non-ascii128 characters or remove them from the username. Drupal.org has a lot of users who have non-ascii128 characters in their names. I'm not sure what we would do to solve this problem.

We can prevent Pathauto from removing punctuation characters from within the Pathauto settings. On my dev site, I've set it not to replace or remove the period, and this seems to have worked for https://opdavies-drupal.redesign.devdrupal.org/user/holly.ross.drupal.

There is also an option for "Reduce strings to letters and numbers. Filters the new alias to only letters and numbers found in the ASCII-96 set.". This is currently not enabled.

We would have to prevent someone from registering with a name that contains only numbers - e.g. a user named "1" would conflict with the actual user 1

Normally the aliased version would be "users/" rather than "user/", I guess to prevent this issue. I'd suggest adding Global Redirect module in addition so that if a user were to do to "user/1" they are then automatically forwarded to "users/dries", for example.

There is a scalability concern to adding 1,000,000 aliases that needs to be tested. This might not really be an issue but we'll know that from someone testing it. If it is an issue, one idea is to only give aliases to the "non-spammers" or maybe only if someone requests one somehow (an automatic process that requires no approval).

Within my holly.ross.drupal testing, I didn't use the bulk generate alias function and instead simply re-saved the user which then triggered the creation of the alias. We could potentially save x number of users in batches via a Drush script or something, or just not generate them automatically and tell people that the next time they log in and update their profile the alias will be created automatically for them?

Thoughts?

greggles’s picture

or just not generate them automatically and
tell people that the next time they log in and update their profile the alias
will be created automatically for them?

I like this idea. I'm not sure how big of an impact that creating aliases might have on db load and using this approach (at least at first) will help to mitigate any huge increase in that load.

joshuami’s picture

I'm not sure how big of an impact that creating aliases might have on db load and using this approach (at least at first) will help to mitigate any huge increase in that load.

I'm a little concerned that when we announce that this is a feature, we'll get similar load issues from lots of folks logging in to claim their URL all at once. That said, the rolling nature of an announcement would be better than the hit of an automated process that slowed the site for an extended period of time.

I wonder if we have had any comparable announcements where everyone would rush to the site to perform an action.

opdavies’s picture

The other thing to consider is paths like https://drupal.org/user/381388/track where the uid is the argument to limit the content of the page. Are these going to stay the same, or do we need to assess updating these also?

greggles’s picture

re #29: I just wouldn't announce it :) But yes, after last summer's breach, every user who had logged in came to change their password and the site roughly stayed online.

re #30: https://drupal.org/project/subpathauto could be availabled for that, perhaps as a followup issue. I wouldn't create an additional alias for each path with uid in it.

opdavies’s picture

re #30: https://drupal.org/project/subpathauto could be availabled for that, perhaps as a followup issue. I wouldn't create an additional alias for each path with uid in it.

I did not know of this module. It looks like it will certainly do the trick. :)

greggles’s picture

Title: User profile URLS from /user/<ID> to /user/<name> » User profile URLS from /user/<ID> to /users/<name>

I think this is the current proposal.

joshuami’s picture

We would like to implement drupal.org/[user:name]. I think the original request was inline with the defaults, but one of our goals is to make the user profile of every Drupal user a bit more prominent and easy to share. The addition of /users in the path makes the URL longer and does not add value.

We are also going to need to set up global redirect. The ancillary pages that sub-pathauto could address are not as important at the moment. I would like to see how many records we end up with in the alias table before we set up sub paths.

If there are no objections or red flags, we will have Oliver push the change to production some time next week. Oliver would you work out a date with Neil for the change?

drumm’s picture

I don't think we can do drupal.org/[user:name], that would be full of conflicts like https://drupal.org/user/135515 and https://drupal.org/user/41414. We could do drupal.org/u/[user:name].

opdavies’s picture

I don't think we can do drupal.org/[user:name], that would be full of conflicts like https://drupal.org/user/135515 and https://drupal.org/user/41414. We could do drupal.org/u/[user:name].

Agreed.

greggles’s picture

Is there some backstory/discussion on #34? I haven't seen discussion around that in a public place.

Not to pile-on the topic, but as a (mostly former) maintainer of Pathauto I think I'm qualified to say that letting people put their username at the root of the site is a risky idea. It would need a lot of testing and perhaps some work to improve core/contrib in order to make it work.

Global redirect for d7 is one option, but the Redirect module is already on the site and #905914: Merge global redirect functions into Redirect module can add global redirect style features.

opdavies’s picture

Global redirect for d7 is one option, but the Redirect module is already on the site and #905914: Merge global redirect functions into Redirect module can add global redirect style features.

That's good news. One less module to install. :)

joshuami’s picture

I agree with using drupal.org/u/[user:name]. That is still short enough to be useful.

drumm’s picture

Drupal.org only has 87,539 rows in url_alias now. We should at least keep an eye on the DB load as this is deployed.

opdavies’s picture

This change has been deployed onto staging, and after saving my profile, I get the https://staging.devdrupal.org/u/opdavies URL.

The Drush commands used were:

drush vset pathauto_user_pattern "u/[user:name]"
drush vset pathauto_punctuation_period 2
opdavies’s picture

I've also added drush vset pathauto_punctuation_quotes 2 to stop apostrophes being being removed, although they are replaced in the URL with %27.

drumm’s picture

Assigned: Unassigned » drumm
Status: Active » Reviewed & tested by the community
Issue tags: +needs drupal.org deployment
drumm’s picture

Title: User profile URLS from /user/<ID> to /users/<name> » User profile URLS from /user/<ID> to /u/<name>
Status: Reviewed & tested by the community » Fixed
Issue tags: -needs drupal.org deployment

Deployed!

tim.plunkett’s picture

So where does this leave users with periods in their name?

Both of these 404:
https://drupal.org/u/tim.plunkett
https://drupal.org/u/timplunkett

I tried resaving my user page to trigger it just in case...

EDIT: Apparently I didn't wait long enough after saving, https://drupal.org/u/tim.plunkett works now.

drumm’s picture

We aren't doing a bulk update - only active accounts get aliased as they get saved. This gets URLs to the people affected by #1034852: Clean up accounts with case-insensitive duplicate names and doesn't suddenly change how big the url alias table is. Varnish could have cached the 404 if you tried those first.

Status: Fixed » Closed (fixed)

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

dww’s picture

Note: this breaks tabs on user profile pages once you have a u/[user:name] path alias. See #2281829: New URL aliases for user profiles breaks drupalorg_crosssite user tabs. I assume we just have to hack a bunch more special-cases into drupalorg_crossssite so it can handle both user/[uid] and u/[name] and still keep everything sane.

mac_weber’s picture

I just created a follow-up issue to make the URLs case sensitive, as it would reflect better the usernames and IRC nicknames: #2494609: Make user profile URL aliases case sensitive username (nickname)