I was looking at this module, and it seems great, but perhaps a bit prone to clashing with other modules due to how it alters the menu. This may not be as much of an issue in drupal 7, but, what if instead of altering the menu and views as it does, we implement custom_url_rewrite_inbound and custom_url_rewrite_outbound to handle switching out the "me" alias? Then for a drupal 7 version you could switch to using hook_url_inbound_alter() and hook_url_outbound_alter().

It could be configured in one of several ways:

  • Allow an option that says "automatically include all identifiable candidate paths", which could use the existing menu_alter logic to find all %user, %user_uid_optional etc... paths, and add them to a list of paths to "rewrite"
  • Views and panels arguments can probably work the way they already do, but might need tweaking.
  • Allow the user to enter a list of custom paths, with a special placeholder in the path representing the "me" alias something like %me perhaps? I'm pretty sure that would never show up in a normal valid URL.

Once configured, you'd have a cached list of paths to be altered that can be turned into a regex or something and checked very quickly. If a match is found, then it's a simple matter to switch out the UID, and alot of the other options, such as doing stuff for anonymous etc... could still work.

What do people think of this idea? It might simplify the module a great deal.

Comments

nohup’s picture

Version: 6.x-2.x-dev » 7.x-1.x-dev

It seems that this might work. If you have done any work on this, please post a patch against the dev branch and I will test it.