I am creating this issue here for anyone who comes across this and feels it is a bug.
What I have done, is added a workaround for #109588: hook_user* should use $account->uid, not arg(1). so that people do not need to patch core to use this module. The downside is, that /user/me/edit will get redirected to /user/uid/edit. There is really no avoiding this at the moment.
If you want to see this problem gone, then please review the above issue and mark it as RTBC. It has already been committed to D7, so we just need to get the D6 version in. :)
If you wish to run with the above patch, then you can use the patch I've attached here to make the me module work as was originally intended. (NB: You will probably need to clear your menu cache and/or hit admin/build/modules for the patch to take effect.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | me-uid-arg-workaround-6.patch | 1.41 KB | cdale |
| #4 | me_module_dec_25.patch | 3.29 KB | luti |
| me-uid-arg-workaround.patch | 2.32 KB | cdale |
Comments
Comment #1
ahoeben commented> The downside is, that /user/me/edit will get redirected to /user/uid/edit.
Note that this is the original behavior of the pre-6 module too. And for me, it was a feature, not a bug. As is, if a not-so-tech-saffy user ('user a') wants to send a link to their own page to someone else ('user b'), they may copy/paste the /user/me link. This will only work for the user a, user b will get a different page. IMHO, the url in the address bar of the browser should be without the dynamic 'me' alias.
I originally modelled the behavior of the module after flickr.com, which also redirects flickr/photos/me to flickr/photos/aldo (provided that I am logged in with a cookie).
Comment #2
mr.andrey commentedThe patch fails against the Dec.25 dev. Any chance of you re-posting it for the updated version?
I have views on user profile that rely on the uid arg, so I would really prefer /user/1/edit rather than /user/me/edit
Thanks,
Andrey.
Comment #3
mr.andrey commentedAfter applying the patch manually, I get this error:
Any ideas?
Thanks,
A.
Comment #4
luti commentedmr.andrey,
probably you've missed some line. Sometimes such messages appear also after some code changes when cache is not cleared. In any case, it works for me fine, and I am attaching my patch for Dec. 25 6.x-1.x-dev version.
---
ahoeben,
I disagree to consider this behavior as a feature. If you decide to use me instead of uid (what is more or less "cosmetic" if we are concerned just about how it looks in users browser...), it shall be consistent (I generally prefer URLs which look more logical / structured instead of just some IDs / numbers...). If you prefer uid, why to use me at all? ;-)
It is simply not logical to have me everywhere but for /user/uid/edit, as generally you don't share this address (or?).
On the other hand, it is (for me at least) extremely convenient to have a possibility to use a "general" link (as /user/me/edit) in some instructions for users or so (I am sure much more users are able to simply click on such general link to get straight to their settings - or some other content - as they are able to understand what uid is and how exactly to compose URL with it...). This functionality (ability to use "general" URLs which include uid in node content, where me is dinamically converted to uid for logged in users and to some other preset URL for anonymous users or users who don't have rights to access this content - for example to instructions about how to register etc.) shall be even in core by my opinion.
As I agree there are situations where user shall be aware of his uid also in case me is generally used (if the site owner/admin decide to use me module), I suggest to:
So, if a web site has contents which users shall share among them (a need for personal uids to be shared), site admin can enable one or another option (or both). If not, there is no need to confuse users with more options as needed, and both options can be disabled for users.
Comment #5
cdale commentedApologies about the delayed response. I'll update a patch. I also think that ahoeben has a valid point about the user/uid vs user/me. I'm pretty sure I can make this a configurable option that will allow the site administrator to choose what they want to use on their site. I'll have a bash at it, and see what turns out. I'll report back here with my progress.
Comment #6
cdale commentedI have just made quite a few additions, and I'm happy enough with it to release as a stable release. See the main project page for a list of features, as well as the release notes for 6.x-1.0.
For those who apply/have applied #109588: hook_user* should use $account->uid, not arg(1). I have attached an updated patch which you may apply, however the patch is not needed for me to work correctly.
Comment #7
ahoeben commentedIt would have made sense to make it 6.x-2.0, since it is a total rewrite.
Comment #8
luti commentedThank you, cdale.
Everything seems to work fine for me (also the patched version).
Comment #9
cdale commentedThis can actually be cleaned up now, but would require users to have Drupal 6.10 or greater. I might wait and see if there are any more bug reports on the 1.x branch before committing this change. I will probably make a 2.x branch for this so users on older 6.x drupal can still use the module.
Comment #10
cdale commentedComment #11
cdale commented