Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
We have a pathauto pattern of [node:menu-link:parent:url:path]/[node:title]
which produces paths based on the menu structure. When there's a <firstchild>
entry, however, the first token breaks as it ends up recursively producing the path of the first child. For example, when creating the first child its value is node/x
, so the path becomes node/x/foo
. When regenerating the path it bcomes node/x/foo/foo
, then node/x/foo/foo/foo
and so on. Currently the only way to resolve this is to manually set the path for the first child (to say bar
, then any siblings would be like bar/qux
).
Comment | File | Size | Author |
---|---|---|---|
#1 | pathauto-token-2295059-1.patch | 1.32 KB | thewilkybarkid |
Comments
Comment #1
thewilkybarkid CreditAttribution: thewilkybarkid commentedThis recognises usage of the token and determines what the
<firstchild>
menu item's parent's path is (including multiple levels), and will use that instead. So for afoo/<firstchild>/bar
structure the path will befoo/bar
.Comment #2
thewilkybarkid CreditAttribution: thewilkybarkid commentedComment #3
Chris Matthews CreditAttribution: Chris Matthews commentedThe 4 year old patch still applied cleanly to the latest 7.x-1.x dev snapshot and works well for me so changing the status to RTBC.
Comment #5
anrikun CreditAttribution: anrikun commented