Closed (fixed)
Project:
me aliases
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
16 Jan 2008 at 09:07 UTC
Updated:
27 Aug 2010 at 05:10 UTC
Jump to comment: Most recent file
There will be a port to drupal 6?
| Comment | File | Size | Author |
|---|---|---|---|
| #43 | me-6.x-1.0.tar_.gz | 2.25 KB | cdale |
| #41 | me.tar_.gz | 2.07 KB | cdale |
| #39 | me.tar_.gz | 1.3 KB | cdale |
| #31 | me-reworked.zip | 885 bytes | cdale |
| #18 | me-6.x-1.0.zip | 9.17 KB | slarosa |
Comments
Comment #1
ahoeben commentedA porting effort is underway as part of GHOP:
http://drupal.org/node/200081
Because of that I have not started my own port just yet. But there will be a 6.x version either way.
Comment #2
lsiden commentedI cannot find anything else about the Drupal 6 port. Has this feature been rolled into the Drupal 6 core?
Comment #3
misterlawrence commentedsubscribing. Would love to see a port to 6 also!
Comment #4
Theokie commentedHi, I made a port to 6.x? Any one interested?
Comment #5
ahoeben commentedSure, if you can post a patch, I will see about creating a release...
Comment #6
slarosa commentedHi,
I tried to port it but I failed in hacking code, so I would be interested in getting your port!
Comment #7
slarosa commentedDear all,
please find attached a working me aliases Druapl 6 port. I hacked this by means od the "coder" developer module. Probably my code isn't neat, but it works. I hope that ahoeben will take care of all oddities...
Best regards,
Salvatore
Comment #8
ahoeben commentedComment #9
TheShniz commentedI've been eagerly awaiting this to be ported to 6.x, and was pleasantly suprised to see your post Salvatore! I did have to use 'EOL Converter' to change the linebreaks (from MacOSX) so it would upload & read correctly in apache, but I've tested it working... to a point.
user/me *does* redirect to users/username... but I can't get any other aliases to work. I've entered user/me/imce and user/me/weather, but they are pushing to a 404 (page not found).
w00t, one big step closer :)
Comment #10
ahoeben commentedIf you have user/me working, user/me/weather should automatically redirect to users/[uid]/weather too. At least, that's how it is supposed to work, but I have not tested the D6 port.
Does users/[uid]/weather exist? Does users/me/edit work?
Comment #11
TheShniz commentedYes, I totally agree with you... but when user/me/whatever wasn't working, I added those paths manually to see if I could force them to work.
1.) user/[uid]/weather *does* work just fine. <<<< Note, user is singular (no 's')
2.) users/me/edit AND user/me/edit does *not* work.
I've tried weater, imce, and edit each with 'user' and 'users'... both with and without user/me/whatever entries (as in, with only user/me specified by default).
Comment #12
slarosa commentedWhat I have learned of the "me" module is that it scans a list of manually entered patterns, finding "me" and converting it to $user->uid.
So, if you wish to enable goose/me/.../scrooge, you have to configure such a string manually, using the "site configuration" menu and then going into the submenu called "me aliases"
Also pay attention to all such nasty HTML WYSIWYG editors. Go disable them all in such a "me aliases" form entry! For instance, using FCKeditor you could enter (in two distinct rows):
user/me
blog/me
but the REAL string will be
<P>user/me></P><P>blog/me</P>And this will break the substitution algorithm inside the "me" module...
Hope this helps
Best regards,
Salvatore
Comment #13
TheShniz commentedYes, I went to "Administer > Site Config > 'me' Aliases" to manually add the patterns (which didn't work with or without for me).
The first thing I did after enabling the me module, was to exclude "admin/settings/me" from FCKeditor (which I do have installed)... so this wouldn't affect the entries (as you pointed out).
It's difficult to get more feedback without others knowing about this particular thread... perhaps a note could be made on the project page to help get more testers?
Comment #14
slarosa commentedI subscribe the idea of the note page and of starting a "Drupal 6 alpha" release, in order to get more people on this wagon and make ahoeben work more visible... Currently, it is the only easy way create menu entries such as " My blog", "My ..."
Frankly, I ported the module just to implement a pair of "my... " entries in a website I am hammering, so I admin I did not a careful test job...
Comment #15
Magnity commentedWould it be possible to create a dev release for this port so that any issues / updates can be tracked in more detail?
Thanks,
Comment #16
slarosa commentedHi,
I did not test a "length-3" path such as foo/me/bar, I just checked "length-2" paths such as blog/me (and it works fine).
Two days ago I tested a "length-3" path and it does not work. I suspect it could be related to the pattern matching and "string stripping" bits of code.
Could someone try to test the same "me" settings and "length-3" path tested by TheShniz on a Drupal >>5<< release of the me module? If it works it means I have broken the code, otherwise we should probably investigate some pattern matching issues
Comment #17
slarosa commented@Magnity
I agree with you, but I think the one and only that can do this is the original module manager, i.e. "ahoeben"... I would not interfere with any module roadmap he's developing or planning...
Comment #18
slarosa commentedHi,
please find attached a new release of the me module for Drupal 6. Thank you for all emails and suggestions. I believe this release is working now and I have made a bit more tests:
user/me/invites/new
user/me
blog/me
user/me/invites
In my very first release I forgot to declare "$items" as an array. I fixed it thanks to your analysis.
The me.module file is saved using a Unix-style end-of-line (i.e. a "line feed" without "carriage return"). Use a good text editor.
A request for Ahoeben: do you feel you can open a D6 dev release? The code is 99% yours, I have just adjusted the new fashion of defining menus and callbacks...
Best regards,
Salvatore
Comment #19
TheShniz commentedOkay, I've tried the updated version (and thanx for all your contrib's Salvatore)...
Administer > Site Configuration > 'me' Aliases
user/me
blog/me
Testing...
user/me > users/root
user/me/invites > user/1/invites
user/me/invites/new > user/1/invites/new
^^^ I figured each of those would work just fine w/ the realization of 3-level paths
SOoooooooo........ I tried:
blog/me > 404 NOT FOUND
^^^ The problem was I had blog/me as an alias (which I thought was a requirement)...
...since it wasn't working, I tried blogs/me instead (in Administer) and still got a 404 NOT FOUND.
SOoooooooo........ I deleted blog/me out of Aliases (so only user/me remains), and got it to work!!!
Perhaps I don't understand how 'me' Aliases are supposed to work, but it worked once I removed the entry.
Unfortunately, I'm *still* getting...
user/me/imce > 404 NOT FOUND
user/me/weather > ACCESS DENIED
Whereas it's SUPPOSED to be:
user/me/imce > user/1/imce
user/me/weather > user/1/weather
Wheras '1' is the UserID and 'root' is the Username
...getting closer, but I think something is still missing.
Is 'me' aware-of/hooked-into 3rd-party modules?
Comment #20
ahoeben commentedPlease stop changing the subject. I have added a link to this issue on the project page.
Second half of december I will be working on several websites, some of which will be Drupal 6 based. At the moment I don't have a Drupal 6 based site.
Comment #21
al.ex commented@TheShniz
Maybe the cache was the reason, after I cleared the cache everything worked fine for me...
Comment #22
TheShniz commented^^^ I wished it to be that simple... but nope.
( I've been testing in IE & FF logged on as an Admin & a regular user at the same time )
Comment #23
slarosa commented@ahoeben: thank you for your answer, I will wait for your analysis of the module!
@TheShniz: I have had a lot of module+cache problems in testing various modules, so when I am testing/editing a module I am fanatically emptying the cache before entering any URL or clicking on any link of my development portal...
My "me" installation in Drupal 6.6 behaves well using blog/me (I explicitely put blog/me in the aliases, you must do it because the *only* default alias is "user/me" and nothing else, so I find strange that your setup behaves fine if you do NOT define "blog/me").
I have not any weather installed, however I have IMCE so I will check for the "user/me/imce" combination and will post how my Drupal+me installation behaves...
Comment #24
slarosa commented@TheShniz
I realized that perhaps I was ambiguous in describing my "aliases" configuration! Sorry! In my "aliases" there are these FOUR entries:
user/me
blog/me
user/me/invites/new
user/me/invites
I could avoid the FIRST one ("user/me"), just because this is "hardwired" in the module code but I MUST explicitely define ANY pattern / string that CONTAINS user/me (or - in general - "xxx/me"). So, In your aliases, you MUST have an entry called "user/me/imce" in order to make "me module" work. Is it already so in your configuration?
Comment #25
TheShniz commentedOkay now, drum roll pleaz...
What do you have 'Administer > Site Configuration > Performance > Caching Mode' set to?
( I outright disabled it this time, and all is exactly as it should be. )
...I'm going to test more when I get home, woohoo!
Comment #26
slarosa commented@TheShniz
I have Caching mode DISABLED, all caches disabled in general and page compession ON. I will enable caching when I will go in production mode....
Comment #27
ahoeben commented@slarosa:
If me.module works the way I intended it to work, you should not have to have anything 'further' than user/me in the configuration. user/me/foo and user/me/foo/bar etc should work outright, when user/me is specified. Also, the 'default' of user/me and blog/me are only used when there is no variable for the me.module settings in Drupal's variable table. Once you submitted settings form even once, those two will no longer be used as 'hard wired' values.
Comment #28
cdale commentedI just stumbled upon this module, and issue. The code that follows is NOT tested, and I have just written it into this form here. It simply demonstrates the approach that I would take. Hope the maintainer, or others here find this useful. NOTE: This code will most likely break if another module tries to also override the user load actions. This seems pretty rare however. It may also break other modules that add a loader that begins with %user. By convention this should not happen, as modules should prefix loaders with their module name, but it is possible.
EDIT: See next post for code.
Comment #29
cdale commentedThought about this a little more, added some to_arg functions that will change all links that contain the current uid to 'me' in place of the user id. e.g. user/1/edit would become user/me/edit when on the /user page etc... Basic testing on /user pages shows this as working for me.
Comment #30
luti commentedcdale,
I've just appended your code above (#29) to the slightly "polished" (just cosmetic changes I've made to make coder more happy...) slarosa's module (#18), which BTW didn't work as expected (definitely not as 'me' module in Drupal 5 version!). Patched 'me' module seems to work great now, at least as much as I've tested it (all links to 'user/ID' are replaced with 'user/me', what is good enough for me at the moment; I haven't played with some other combinations though...). Thank you!
Just to be sure - was it supposed to work like that (your code appended to something), or shall I remove anything? I presume only your code is not enough, as I don't see a text match & replace part in it...
Maybe it would be good if you publish the complete code (module), so we can be sure what we are testing (and, discuss about the same module version / code).
BTW, I was not able to get rid of coder complain about '
foreach ($aliases as $alias) {'in line 12 ("The menu system has been completely over-hauled in 6.x..."). You seems to be interested about this module, and much more skilled Drupal / PHP coder as I am - do you have any ideas how to make this part compatible with Drupal 6?Comment #31
cdale commentedApologies, the code was meant to be used stand-alone. What I posted is the entire module. It uses the new menu features available in Drupal 6 to complete the task required of the me module. This is why it looks completely different to the D5 version.
I've attached a .module and .info file here.
Comment #32
ahoeben commentedcdale's module only seems to work for user/me/*, not for blog/me/* etc. It's an interesting approach, but not one I will be pursuing.
Comment #33
cdale commented@ahoeben I'm curious, did you actually test this code?
It will work for blog/me.
Code from blog menu in D6:
Which means that the code I have written, will catch the paths blog/%user_uid_optional, and blog/%user/feed, and replace it with blog/%me_uid_optional, and blog/%me/feed, which will call the me_uid_optional_load, and me_load functions, so it *will* work. Other D6 modules that I have looked at use this exatct same approach, which it makes sense to do when you want to load up a user object.
The only scenario where it will not work, is if the module loads up the user object itself from the uid, which IMHO is a bug with any module that does this in D6, as the purpose of the %user menu wildcard, is to explicitly load up a user object from a uid, and perform sanity checks on the given user input.
If you can prove to me that it will not work, then I will retract this comment, but I can prove that it does work.
I will point out, that you will need to rebuild the menu in D6 before the changes take effect. This can be achieved by visiting the admin/build/modules page.
Comment #34
luti commentedcdale,
thank you for your efforts.
I've installed your last version (from #31). Everything seems to work well but user data editing (that's what I've noticed also with previous code, unfortunately after I've published my post #30). I come successfully to the /user/me/edit page, but when I change for example timezone setting and hit the button to submit changes, there is the following error message displayed:
Changes are not accepted, so this makes the use of this module - as it is at the moment - impossible (users shall be able to change their settings...).
If I disable 'me' module, it works well again.
I hope it is not something serious, because everything else seems to work great.
Comment #35
slarosa commentedHi all,
about #33: such a code does mean that an administrator should write php/drupal code snippets when using the proposed "me" module, in order to configure callbacks for his/her own menu items? I am asking this because the original ahoeben code was meant to offer a high level interface in order to avoid any "contact" between administrators and the php language and I would like to be sure that any new implementation will NOT require any php-drupalese coding skill for administrators, otherwise it would be a kind of "usability regression"...
I am interested in eventually defining and sharing a "me module" for D6 with "no php knowledge required". However, I was using for six weeks #18 with the #24 configuration and it is working on my D6.6 installation with no side effects... At least, no *apparent* side effects, I suppose... All in all, it is the same of the original "me" module with some menu code/callback adaptation in order to make D6 stop complaining about overhauled coding standards... So I will wait for you to consolidate a definitive "D6" port before upgrading my test site module...
Comment #36
luti commentedslarosa,
was the page /user/me/edit displayed properly in your system?
This was not working for me at #18, while it works on my Drupal 5 site, and I also don't have problems accessing /user/UID/edit otherwise...
Comment #37
ahoeben commentedcdale: sorry, no, I did not test the code. I guess I misunderstand the menu_alter code you wrote.
Does it work with tracker and contact modulesm as well as views where the uid is passed as an argument?
Comment #38
cdale commented@ahoeben: That's alright, I had a feeling that was the case. It's not immediately obvious exactly what the code is doing.
As for those modules - Contact: It will work for the user/me/contact path.
Tracker: It will work with the tracker/me, user/me/track, and user/me/track/posts.
Views: This will require a bit of extra code. I think I know how to do it though.
Basically, any module that uses one of %user, %user_uid_optional, or %user_category in any paths in their hook_menu(), then the me module will work for those paths. it will even work as expected for anonymous users. A quick search though core reveals that these paths will work as expected:
BLOG:
blog/me
blog/me/feed
CONTACT:
user/me/contact
OPENID:
user/me/openid
user/me/openid/delete
STATISTICS:
user/me/track/navigation
TRACKER:
tracker/me
user/me/track
user/me/track/posts
USER:
user/me
user/me/view
user/me/delete
user/me/edit
user/me/edit/[user category]
I will have a look into the views stuff. I'm never really done much programming with views, but I think I can see how views2 works. Stand by and I will see what I can come up with.
Comment #39
cdale commentedThis version should include 'me' alias support for the views User:UID arguments. i.e. you could do something like myview/me or myview/1+me+7 etc... provided the view is setup to include a user:UID argument.
I will mention, that using a wildcard of 'me' to indicated *all* user ids, will not work with the me module installed.
I will also mention that I have never really worked with views before, so I'm unsure if what I have doen is anywhere near sound or correct. I can also say that I have only done basic testing with views. More in depth testing will be required before I'm sure this works as expected in all circumstances.
Comment #40
cdale commentedSorry, forgot a use case. New patch shortly.
Comment #41
cdale commentedOk, This should work with all the paths mentioned in #38, as well as the uid argument in views.
New features:
Administrators with the 'administer me settings' permission can change what the 'me' alias is. i.e. they can change it to 'mine', or 'mi' if you're italian for example. At the moment, a validation routine is in place to make sure that only alpha characters are used. i.e. [a-zA-Z].
There is an option that allows the alias check to be case insensitive. i.e. a user could go user/me or user/Me or user/ME or user/mE and they would all end up at the same place. This option is off by default.
Comment #42
ahoeben commentedcdale, would you like (co-)ownership of this module? You obviously have more time to spend towards it than I do ;-)
Comment #43
cdale commentedahoeben, I'd be happy to look after a 6.x version of this module. I could potentially also help out with a 5.x version, but I do not currently have a 5.x install anywhere to test. I'll need to get CVS access first though. :)
Coincidentally, here is what I believe to be a 'release' worthy 6.x version.
Comment #44
AjK commentedCVS account application approved and also added to this project as a co-maintainer.
Comment #45
luti commentedI've installed the latest version of 'me' (as in #43).
My issue reported in #34 is still unresolved (and, it seems to be more or less overlooked, as there is even no comments about...), altough by my opinion critical - as such implementation of 'me' module (as at today) breaks one of the basic Drupal functions - a possibility for the user to edit his own settings...
Besides, info file seems to be incomplete, what makes 'me' not to be listed at the available updates page. I've added:
(altough maybe even 1.0-alpha is a bit too early, considering it breaks Drupal core functionality).
Comment #46
cdale commented@LUTi: Thanks for testing. :) I did not pick up on this. Have you come across any other problems in your testing?
As it turns out however, this is happening because of #109588: hook_user* should use $account->uid, not arg(1).. You are welcome to either apply the patch listed there (If so, please post your feedback in that issue, and here to let me know if that patch does not fix this issue. My testing shows that it does.). or continue using the versions posted in #7 or #18. I will have a think about this issue also.
Regarding the info file, me has no updates, and I left those items out in anticipation for making a release as per Writing .info files (Drupal 6.x), version and project are added by the drupal.org packager.
Comment #47
luti commentedcdale, thank you for your feedback.
After applying your user-arg2account-109588-13-D6.patch (as in #109588: hook_user* should use $account->uid, not arg(1).; I've also replaced $user with $account, as suggested in #16 there) everything seems to work great! :-)
On my Drupal 6 test site, 'me' will be on since now, and I will for sure report any problem I might notice (altough I don't expect many, as I've more or less tested all I need/use).
About the fields in info file (my previous post) - I know that this part is added automatically by Drupal packager, once the package is so far... ;-)
But, I simply hate to have any modules installed, but not have them listed on "available updates" page - as this is, for my taste, the most simple way to check the site from time to time (if anything shall to be updated). Therfore, I usually put all the info needed for that (also including the current timestamp). I am just not sure if I would be notified, when an "official" version for Drupal 6 will become available, if my current version is not listed there... ;-)
In any case, I believe your 'me' version is so far that we can have at least some 6.x-1.0-beta "officially" published. But, I would suggest to include the patch for core user module right into the package (so it wouldn't be so easy to forget about when a module is installed), and also to put an explicite note on 'me' home page (ahoeben?).
Comment #48
Rosamunda commentedSubscribing. I really need this :)
Comment #49
cdale commentedI personally think it is a bad idea to release a module that requires a core patch.
@LUTi: you have said that the patch worked, perhaps you could add a comment in #109588: hook_user* should use $account->uid, not arg(1). stating this. Always helps to have people who are using the patch say that it is actually working, this way it will make it into core much quicker.
@ahoeben: What were your thoughts on a release approach for D6? Would it have been similar to #18? Or were you considering something different altogether?
Comment #50
Rosamunda commentedI´ve changed the title for better tracking.
Comment #51
maxchock commentedHi,
I'm using drupal 6.6 and I have install the Me Alias module downloaded from #43. After install and enable the module, there is 2 place I believe it's not working well:
1- I found the "me" alias is not working because it show "Page not found" error.
2- Existing link http://www.buddyjoy.com/photos/user/album/1 , http://www.buddyjoy.com/photos/user/flash/1 have change to
http://www.buddyjoy.com/photos/user/album/me and http://www.buddyjoy.com/photos/user/flash/me after enable Me alias module. But click on the link bring me to Page not found error.
why is this happen? do i need some extra configuration??
Comment #52
cdale commentedThe me module is working as it is programmed to do. It is the photos module that appears poorly written. I will post an issue in the photos queue.
Comment #53
luti commentedcdale,
I feel extremely uncomfortable when I have to patch the core to get some module work, so I generally agree with you. Fortunately, this is the only patch in Drupal 6.x, while I've had to have more core patches in Drupal 5.x... :-)
But, considering this is the only way to get me module work 100% (for my needs), and this is for me a very important feature (to be able to make general links somewhere in content which would work well for all users), I have to do it. So, I wote to still have such a module (instead of not having anything yet). Furthermore,I think this should even be a core functionality, so there are Drupal maintainers who should come towards to "us" in this case by my opinion (at least changing the core module ASAP).
About adding my comment to the core patch (confirming that there are no "side effects"), I have to check everything a bit better. I've checked 'me' functionality as much as I need it, but I'd like to see that there will be no issues somewhere else... As it is just a test site at the moment, this will take some time (I have to check everything, no other visits...).
Comment #54
Magnity commented@ahoeben, is there a release plan as @cdale asked in #49?
From my perspective at least, it would be extremely useful to have at least a dev release out, even if patching core is not ideal.
- Tracking of d6 specific bugs in their own threads
- Linking in to update module so that when changes are made, we know to update
Thanks,
Comment #55
cdale commentedI've just created a dev release that includes a workaround for the user editing problem so people should not have to patch core.
I'll update the front page once the packaging script runs and the release is available.
I'm marking this as fixed, so if anyone comes across any problems, if they could create a new issue.
Comment #56
luti commentedIn this version, URL /user/me/edit is converted into /user/uid/edit (uid = user ID number), while all other links (as user profile edit pages, newsletter subscriptions etc.) are with me (for example /user/me/edit/newsletter). Both seems to work.
Shall it be like that, or shall also /user/me/edit be used (as in the previous solution, without a workaround to avoid core patch)?
I am still using patched core user module (as I think it should find a way into the core in any case...), if it is of any importance for this post.
Comment #57
Magnity commentedThis is also the case without the core patch.
@cdale may wish this to be put in a different thread though, as this thread was mainly about the port and we're now looking at bugs/features of the new release.
Comment #58
cdale commentedI have created #350962: /user/me/edit is converted into /user/uid/edit to address this.
Comment #60
sarav.din33 commentedHi friends,,
Is it possible to use the "Views path" in me module?....
For example....
In built views "fl_public" had several views path like as follow as,
user/%/community/friends
user/%/community/sent
user/%/community/received
user/%/community/following
user/%/community/followers
Here "%" indicates the "userid", for this i use the me module but the page could not show the correct results....
How can i achieve this. Please guide me on this issue as soon as possible...
Thanks & Regards
Sarav...