Closed (fixed)
Project:
Pathauto
Version:
5.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
6 May 2008 at 14:19 UTC
Updated:
5 Jul 2008 at 18:33 UTC
Jump to comment: Most recent file
I am trying to use pathauto to generate custom paths based on the top parent of a book. I have tried several different options including [menupath-raw], [book-raw] , and many others as the pattern for Book page paths. When I create a sub-page of a book, they all fail silently, except for [nid] and [title-raw].
Have I made an error in the pathauto admin or is this a bug?
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | 255286_5x_code_flow_sync.patch | 2.03 KB | greggles |
| #3 | 255286_pathauto_bookpathalias_update_for_6x.patch | 2.27 KB | greggles |
Comments
Comment #1
mikeryanDuplicate of token issue http://drupal.org/node/223458, fixed in the 6.x-1.x-dev release.
Comment #2
gregglesActually, bookpathalias is the responsibility of Pathauto so we need to fix that.
Comment #3
gregglesAnd here's a patch which does this.
I wish there were an API for getting the menu data but all of the menu API functions I could find expected me to have the menu router or path and then it would return the other data.
I also re-ordered the code so that the book stuff is separated from the term/cat stuff, but if we do that then maybe we need to do just that re-organization for 5.x as well.
Comment #4
Freso commentedDefault node pattern: [title-raw]
Book page pattern: [bookpathalias]/[title-raw]
Making a "book page" on the top level triggers a couple of notices:
The last one goes away with the patch applied.
Making a node "Super" as the top-level book entry creates a node with the alias "super". Pre-patch, making a node "Sub" as a child node of "Super" creates alias "sub". Post-patch, making child node "Sub 2" creates the alias "super/sub-2".
Marking RTBC.
Comment #5
Freso commentedEh. Oh, one more thing though. The SQL query is surrounding by superfluous double quotes. The attached patch is the one I tested - it is basically identical to the one in #13, it's just got a pair of double quotes changed to a pair of single quotes. :)
Comment #6
Freso commentedOr... not attached. Let's try again.
Comment #7
Freso commentedThat bug is really annoying.
Comment #8
Freso commentedComment #9
Freso commentedComment #10
Freso commentedBloody hell. I give up.
I changed
+ $parent_node = db_result(db_query("SELECT link_path FROM {menu_links} WHERE mlid = %d", $object->book["p$i"]));to
+ $parent_node = db_result(db_query('SELECT link_path FROM {menu_links} WHERE mlid = %d', $object->book["p$i"]));Comment #11
gregglesFixed. Now to make the code structures a little more consistent...
Comment #12
gregglesI didn't commit that last patch...if this lack of similarity becomes a problem in the future we can worry about it then.
Comment #13
gregglesWell, now I accidentally committed the patch from #11 as part of http://drupal.org/cvs?commit=122748
So, yay synchronization!
Comment #14
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.