Closed (fixed)
Project:
Pathauto
Version:
7.x-1.x-dev
Component:
Documentation
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
18 May 2010 at 02:03 UTC
Updated:
16 Feb 2015 at 03:14 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
gregglesAwesome - thanks for letting us know!
Can you describe how the integration works? Was it tokens that you started to provide or some Pathauto integration specifically?
Comment #2
icecreamyou commentedSure -- you can take a look (specifically lines 2187-2277, plus Token integration is clearly labeled a few hundred lines up, or just search for "Pathauto integration"). I already had Token integration because I was using it with Activity. But FBSS provides its own entity (the statuses) and I recently added a feature for each status to be shown on its own individual page instead of in a list via Views. The default path for each status is
statuses/[status-id]but I wanted users to be able to automatically alias those pages to be whatever path suited them, for exampleuser/[poster-id]/[status-id]like on Twitter. So I implemented hook_pathauto() (the docs for that, by the way, don't mention the "patterndescr" property of the returned object, IIRC -- I figured it out by looking at Pathauto's implementation for nodes) and hook_path_alias_types() and then wrote the bulk update function.The only confusing part was using the $placeholders parameter of pathauto_create_alias(). The docs were wrong, and I had to dig around to realize I needed to use pathauto_get_placeholders() from pathauto.inc. I also had to look through token.module to find token_get_list(). The node implementation in pathauto_node.inc was very helpful.
Comment #3
gregglesInteresting - thanks for the explanation.
Any chance you could provide a patch for the bad documentation? I'll happily review/commit it!
Comment #4
icecreamyou commentedSure, I'm pretty busy today but I'll see what I can do.
Comment #5
icecreamyou commentedI'm also not sure the last section (the "this is basically not true any more" part) needs to stay in, but I didn't remove it because I have no idea what it's talking about.
Comment #7
icecreamyou commentedI'm currently in the process of updating FBSS to support Pathauto for D7... here's a patch against 7.x-1.x.
I didn't update pathauto.api.php but this patch explains the hooks in it.
Comment #8
dave reidWe actually need to get rid of API.txt and be using pathauto.api.php only. The documentation needs to exist there.
Comment #9
dave reidComment #10
mojzis commentedI just ran into those historical instructions in API.txt, featuring
It gets one puzzled :) If I get it right, you would like to remove this file completely but don't want to because not all info is in api.php yet ?
Would it help if i try to move it / update it into api.php ? If i get it right, the settings hook should be advertised there, as well ?
thanks :)
Comment #11
mojzis commentedAttaching the first version of the first hook described to make sure we understand each other.
Comment #12
kristiaanvandeneyndeCould we get the documentation in?
Currently, lines 11-15 of pathauto.api.php explain nothing. Even worse, there is still an API.txt file which contains perhaps old, incorrect information. As the module author it shouldn't be that hard to document the following two functions (one is documented in #11's patch even):
Comment #13
m4oliveiI did a sweep of README.txt, combined the existing patches, moved all developer docs into pathauto.api.php and removed API.txt. I also filled out the undocumented hook and added examples in the body of the hooks where there were missing ones. Thoughts? Can someone check my work for correctness?
Comment #14
kristiaanvandeneyndeLooks way better to me already!
Comment #15
m4oliveiComment #16
dave reidFixed a few things that PHPStorm caught like missing return value, or missing return types in phpdocs.
Comment #19
quicksketchThis looks great!
I only noticed one small error:
Should include parenthesis:
But that's minor. Looks like this has been committed. Thanks for writing all that up!