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).

CommentFileSizeAuthor
#1 pathauto-token-2295059-1.patch1.32 KBthewilkybarkid
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

thewilkybarkid’s picture

This 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 a foo/<firstchild>/bar structure the path will be foo/bar.

thewilkybarkid’s picture

Status: Active » Needs review
Chris Matthews’s picture

Status: Needs review » Reviewed & tested by the community

The 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.

git apply -v pathauto-token-2295059-1.patch
Checking patch menu_firstchild.module...
Applied patch menu_firstchild.module cleanly.

  • anrikun committed d56d72d on 7.x-1.x authored by thewilkybarkid
    Issue #2295059 by thewilkybarkid: Breaks the [node:menu-link:parent:url:...
anrikun’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.