Closed (fixed)
Project:
Pathauto
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
19 Feb 2010 at 10:21 UTC
Updated:
6 Mar 2010 at 14:40 UTC
Jump to comment: Most recent file
I am using
Pattern for all Book page paths
[node:bookpathalias]/[node:title]
I add a book page called "Colours" and in book outline > create a new book
expecting to get a url
domain.com/colours
but actually get
domain.com/node/14/colours
creating a child page for this book called "Yellow" gives a url of
domain.com/node/14/colours/yellow instead of domain.com/colours/yellow
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | 719184-pathauto-bookpathalias-D7.patch | 3.72 KB | dave reid |
Comments
Comment #1
dave reidConfirmed. On it and tracking it down.
Comment #2
dave reidOMG... Looking at our bookalias token code and I'm struggling to figure out why it's so complex.
We currently have:
When we *have* the parent information right in $node->book['plid'] (same thing book.module uses when creating its 'Up' navigation link on book pages).
Is there a reason for the complex parent calculation?
Comment #3
dave reidAnd just to be clear, the following should be the expected behavior for this token so I can write a test for this:
Book node type pattern: [bookpathalias]/[node-title]
Node 1: First (root) page in book:
Title: Root page
Generated alias: root-page
Node 2: First sub-page of node 1
Title: First sub page
Generated alias: root-page/first-sub-page
Node 3: Second sub-page of node 1
Title Second sub page
Generated alias: root-page/second-sub-page
Node 4: First sub-sub page node 2
Title: First sub sub page
Generated alias: root-page/first-sub-page/first-sub-sub-page
Comment #4
dave reidAlso, what should be done if a page doesn't have an alias? Should we return the un-aliased path (e.g. 'node/2') as the bookpathalias token?
Comment #5
greggles#2 - I'm not really sure how we missed that aside from "plid" not being all that intuitive.
#3 and #4 - those seem right to me.
Comment #6
dave reidHere's the patch for 7.x-1.x with the very simplified parent fetching to run through the testbot. This would be backported to both 6.x branches.
Comment #7
dave reidCommitted to all three branches + passing tests.
http://drupal.org/cvs?commit=331066
http://drupal.org/cvs?commit=331068
http://drupal.org/cvs?commit=331070
http://drupal.org/cvs?commit=331072
http://drupal.org/cvs?commit=331076
http://drupal.org/cvs?commit=331078
Comment #8
artatac commentedWorking well now - thanks