I noticed that category_pathauto.module you implement maky of the pathauto hooks. As of Pathauto 5.x-2.x the purpose of some of the hooks has changed and you should move to using the token module's functions. I imagine that in the next couple of weeks that version will become stable enough that it will be the default release at which point you will need to implement the token hooks instead of (or in addition to) the pathauto hooks in order for the integration to work.
Instead of that function, you should now implement two new functions:
hook_token_list
hook_token_values
For more information see the API.txt in the token module http://drupal.org/project/token
During a migration period when some users may still be using Pathauto5.x-1.x it is probably best to leave the hook_pathauto_node in your module so that your module is compatible with both versions.
If you would like more assistance, you can ask questions in the tokens group: http://groups.drupal.org/tokens so that they are around for other folks making the crossover.
For an example you can look at the change in pathauto_node_event.inc
http://cvs.drupal.org/viewcvs/drupal/contributions/modules/pathauto/cont...
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | category_pathauto.module.patch | 2.98 KB | knseibert |
| #2 | category_pathauto.module_0.patch | 2.83 KB | bdragon |
Comments
Comment #1
mr.andrey commentedWhat's the status on this?
I'm using the latest version of Category and [categorypath] and [categorypathfirst] tokens don't work.
Thanks,
Andrey.
Comment #2
bdragon commentedHere's an (untested) patch.
I'd appreciate if you'd test this and make sure I didn't screw anything up during the conversion.
Thanks,
-Brandon Bergren
(Interim) Category maintainer
Comment #3
gregglesHey bdragon - the example I pointed to actually doesn't work :( sorry.
You want to remove the references to pathauto since it's just token module (which pathauto relies on) that needs to be integrated with.
So, category_pathauto_token_values(...) should be category_token_values(...)
And the comments about the token_values and token_list functions could be modified to drop the "pathauto" from the description.
Other than that, your implementation looks reasonable, though I don't know enough of the category code to say whether it's right or not.
So, it needs some slight work but is 99% of the way there as far as I can tell.
Comment #4
p_palmer commentedCan someone re-roll with greggles suggestions ?
Maybe you can sort it greggles ? If not, nice one on the comments :)
Ta
Comment #5
gregglesThe changes I suggested are trivial - it just needs bdragon (or another committer) to find some round tuits ;)
Comment #6
bdragon commentedYep, should get another shipment of tuits in soon ;)
Comment #7
p_palmer commentedWaiting at the docks for that shipment of tuits ;)
Comment #8
mr.andrey commentedAny ETA on the ship? ;-)
Comment #9
bdragon commentedMeh. Could someone just do the fix and test it for me? I'm really having time issues...
Comment #10
mr.andrey commentedHello there,
I just applied the patch, and replaced "category_pathauto_token_list" with "category_token_list" - the category aliases still don't show up on the pathauto settings page.
I'd like to get this going, as it sounds like a very small fix that needs to be done.
Any ideas?
Andrey.
Comment #11
gregglesmr.andrey - when something like that happens generally the way that the code is addressing the data is wrong.
I generally add a "drupal_set_message(print_r($object, true));" to the code right about the part that isn't working and see what comes out. Then it becomes clear what needs to be changed in the code.
Comment #12
mr.andrey commentedIt seems to get this far, thought the list of tokens is not generated, and entering [categorypath] anyway doesn't do anything.
I'm not entirely sure what I'm looking for...
Andrey.
Comment #13
knseibert commentedGot it.
The category_token_list did not return the $tokens array.
Functions renamed according to greggles input, however these functions are still in the category_pathauto.module and not within category.module itself.
Patch attached.
Cheers.
Comment #14
clkeenan commentedCan someone explain to me how to implement this patch as I believe I am having this same problem? Thanks!
Comment #15
gregglesIs this ready to go?
@Bdragon - if you don't want this in the core category module please let us know so that someone can create a helper module. Thanks.
Comment #16
gregglesIf you are unsure how to apply patches - http://drupal.org/patch/apply
Comment #17
bdragon commentedOops!
I guess I missed the issue email.
Applied to HEAD, DRUPAL-5, DRUPAL-4-7.
Comment #18
bdragon commented#13 that is.
Comment #19
falk_g commentedDoes that patch make category work with pathauto 2? Is it working is it tested? Does it need testing?
Comment #20
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #21
msielskiThis patch works great... any thoughts on incorporating it into category.modules head?
Comment #22
esmailzadeh commentedcategorypathfirst generat merged url for example
instead of news/commercial/my-first-news generate newscommercialmyfirstnews
Comment #23
esmailzadeh commentedany idea for this issue?
i am realy confused any thing for categorypath of category and container works well but when categorypathfirst setted for other node types ,this put merged url for urlaliase
for example
if container is: news
category: commercial
node title: my first news
url alias maked as: newscommercialmy-first-news
instead of : news/commercial/my-first-news
how can i solve this problem
i think this is caused by url filtering
thanks all
Comment #24
gregglesIssues are different than normal comments - when you change the "issue title" in the comment it changes the whole issue title.
I believe the problem is with categorypathfirst which should be renamed to categoryfirstpath - pathauto has special handling for tokens that end in "path" or "alias" or "path-raw" or "alias-raw" that will leave the / inside of the token.
Comment #25
esmailzadeh commentedok sorry for changing issues title,
thanks man
i will test it and as soon as possible reply how it works..
i am realy confused why a module like category with this great idea have these bugs and dont put these patchs in core of module