Closed (fixed)
Project:
Pathauto
Version:
4.7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
18 Oct 2006 at 14:32 UTC
Updated:
23 Jan 2010 at 17:30 UTC
Jump to comment: Most recent file
After a lot of sweat and tears I've made my first drupal contribution...
the file attached needs to come in the contrib dir as "pathauto_xtracker.inc"
* aliasses for all xtracker type tabs
* alias of the xtracker tab in the profile page
please validate if it works
and also send in comments on the development...
what did I doo wrong, what could be better, does it comply to the standards.
| Comment | File | Size | Author |
|---|---|---|---|
| #29 | pathauto_user.inc_.patch.txt | 11.33 KB | ednique |
| #28 | pathauto_taxonomy.inc_.patch.txt | 2.83 KB | ednique |
| #27 | pathauto_node.inc_.patch.txt | 2.83 KB | ednique |
| #26 | pathauto.module.patch_0.txt | 1.4 KB | ednique |
| #25 | hook_pathauto_user_0.txt | 2.83 KB | ednique |
Comments
Comment #1
gregglesI believe it can be done in the contrib directory as you have supplied or in the xtracker and subscriptions modules - Organic Groups currently implements the hook_pathauto_node and that is probably the best way to go. Currently we lack a pathauto_user hook, but we can certainly add one. That seems like the more modular way to approach this rather than the use of the contrib directory.
If you agree with that approach then we can work on getting your code included into xtracker and then creating the invoke(pathauto_user) that will achieve your desired results.
Take a look at function og_pathauto_node($op, $node=NULL) { at the bottom of http://cvs.drupal.org/viewcvs/drupal/contributions/modules/og/og.module?...
Thanks very much for your work on this - I look forward to getting this implemented.
Comment #2
ednique commentedthe hook_pathauto_node cannot be used here as xtracker is not a node...
There's definatly a need for hook_pathauto_user...
To be able to do the user part, I had to use hook_user...
but what if one day xtracker itself uses hook_user...
Thus indeed the better location is the xtracker module itself...
Finally, I figured out that the code attached has not taken into account that the user can change the tabs of xtracker to list by taxonomy terms...
And the xtracker module should in the event of that change, alter the current paths...
thus indeed a tighter integration is needed...
Comment #3
greggles@ednique - thanks for the further investigation. I've updated the title (and status) for this issue to reflect your more recent investigation. I hope that you will continue pursuing a patch to xtracker and perhaps provide a patch for pathauto to add the hook_pathauto_user.
If you don't have the time to provide the patch here in pathauto then just let me know and I will do it. Until then I'm respecting the fact this you've assigned this to yourself.
Comment #4
ednique commentedOK... I've cracked the nut...
I can only add 1 file, so I will be posting the files one by one...
What I've done:
file also attached
Comment #5
ednique commentedhook_pathauto_user()
see attach
Comment #6
ednique commentedPathauto_user.inc patch
see attach
Comment #7
ednique commentedpathauto_node.inc patch
see attach
Comment #8
ednique commentednew file :: contrib/pathauto_blog.inc
see attach
Comment #9
ednique commentedNew file :: pathauto_contact.inc
see attach
Comment #10
ednique commentedNew file :: contrib/pathauto_tracker.inc
see attach
Comment #11
ednique commentedAll done...
the pathauto_contact.inc also needs to come into the contrib directory...
Please review the code...
Comment #12
greggles@ednique - all I can say is WOW! This is great work, thanks for undertaking it.
I haven't had time to review the patches yet, but will do so in the next week or so.
Again, thanks so much for your effort on this. It sounds like some great ideas and some great re-organizing of the code, so I look forward to being able to commit this.
Comment #13
ednique commentedAs an example I've made the xtracker (http://drupal.org/project/xtracker) integration.
1) In the admin/settings/pathauto it has its own "Xtracker path settings"; thus uses hook_pathauto and hook_pathauto_bulkupdate
2) In the user pages it adds a tab and uses the hook_pathauto_user()
3) within the xtracker pages there is a tab called "my posts" and thus this can have a pattern containing the username. Therefore hook_pathauto_user() is used to change the link on that tab when a user changes his username, a new user is created or one is deleted.
For now, while testing and untill xtracker adds this code into the module, you can put this file in the contrib directory... So don't commit this file...
Comment #14
ednique commentedwhile doing
node aliasses of that user are altered if [user] is used (change in pathauto_node.inc)I didn't use the hook_pathauto_user as supposed to...The file attached, supplies the new node patch and the next message supplies the new user patch
both to be executed on the current 4.7.0 code...
Comment #15
ednique commentedHere's the new user patch...
these both files REPLACE the initial patch files listed above in #6 and #7
Comment #16
bluecobalt commentedI'm wondering why this work never got committed? This seems like incredible work.
As the 4.7 version of pathauto currently stands, it doesn't update any paths when a user changes their username, which is a major issue.
I was able to use some of the code from comment #15 to get pathauto_user.inc working correctly, but can't get pathauto_node.inc working. I added the code from comment #14, and it doesn't work. Am I missing something?
This is a huge problem for us, because we're using the usernode and nodeprofile modules for user profiles, with the username set in pathauto as the path for the usernode. If someone changes their username, their profile can no longer be accessed until we go in and fix it manually.
Any thoughts on how to fix this?
Comment #17
gregglesWhy didn't it get committed: it's a big change, the patch is in the wrong format, and nobody else has reviewed it. All of those things make it harder for me to review and decide that it should be committed.
In your comment you state that some of it works but some of it doesn't. If you could improve it and get it to a working patch and also do a review of the patch then it would be more likely to be committed.
I know there are problems with Pathauto - there are in fact hundreds of them. But I can't fix them all without help.
Comment #18
ednique commentedI have it running ever since...
Maybe you need all the files posted above...
some are patches, some are complete new files...
They alll need to be there...
If I get to it, I'll make a new set of instructions...
I'll use the latest pathauto code and see what differs...
Comment #19
gregglesThanks ednique - it would be really helpful if you could re-roll it for the most recent version of 4.7 and/or 5 and also use a diff that puts them all in one file.
Comment #20
ednique commentedI will submit all changes that I have done to pathauto.
these include all changes reported here in the issues:
http://drupal.org/node/89906 :: user
http://drupal.org/node/92183 :: node and taxonomy
http://drupal.org/node/73017 :: contact tab
http://drupal.org/node/91748 :: blog feeds
Comment #21
ednique commentedNew file pathauto_blog.inc :: add to the contrib directory
Comment #22
ednique commentedNew file pathauto_contact.inc :: add to the contrib directory
Comment #23
ednique commentedNew file pathauto_tracker.inc :: add to the contrib directory
Comment #24
ednique commentedNew file pathauto_xtracker.inc :: add to the contrib directory
Caution: this is an example file of how another module can use the new functionalities.
This file is for the xtracker module.
Normally that file should be incormporated into the module itself.
Comment #25
ednique commentedNew file hook_pathauto_user.txt :: add to the pathauto directory
Proovides usage information on the user hook
Comment #26
ednique commentedChanges for pathauto.module
Fixes the blog feeds aliases when username changes...
Comment #27
ednique commentedChanges for pathauto_node.inc
adds user and taxonomy change triggers
Comment #28
ednique commentedChanges for pathauto_taxonomy.inc
providing a pathauto_taxonomy() hook
+ catpath correction
Comment #29
ednique commentedchanges for pathauto_user.inc
* strip out other then user functions and put them intp contrib directory
* make pathauto_user() hook
* change in name bug fix
* default pattern for all user tabs
* Each user tab can have it's own pattern
* The default "view" tab is the one that was there before
* You can select [tab] to display the original URL (edit, track, ...)
* You can select [tabname] to display the text that is shown in the tab (edit, tracker, ...) and if translated, you'll get the translation (bewerken, opvolgen, ...)
Comment #30
ednique commentedSo that's all folks!
posts 20 untill this one give you a lot of changes.
Please apply all changes and new files in order for them to work.
Then check the new admin interface changes for user...
these are all for 4.7.x ONLY.
Comment #31
Chris Bray commentedAre these patches still the right way to add automatic paths for non-standard modules?
I'm running a small site a http://www.vwdrc.com
I've successfully added http://www.vwdrc.com/blog/username and I want to add http://www.vwdrc.com/contact/username
I'm running Drupal 5.1, does anyone know if these patches will apply cleanly?
Comment #32
dave reid4.x is no longer supported and these hooks are in the D5 and D6 versions.