I hadn't noticed this behavior until upgrading to beta3, though it's possible this was happening before. My menupaths now get turned into one long, single-component path and are prefixed with the name of the menu. To illustrate:

http://example.com/primary-links-foo-bar-baz

instead of the expected:

http://example.com/foo/bar/baz

I'm fairly sure the latter is the intended behavior. Sorry, I do not yet have a patch to offer.

Comments

HorsePunchKid’s picture

Priority: Critical » Normal

Argh, my apologies. This is a result of a quick hack from the ongoing punctuation discussion. Moving the "preserve alphanumerics" block outside the transliteration block causes this. Adding the path separator / to the regex prevents the problem, allowing me to still have punctuation stripped out.

Now I just need to pop the primary-links parent off the beginning of the path components.

greggles’s picture

Status: Active » Closed (duplicate)

Good to know.

If you update to the dev version of token then your menupath problem should be fixed as well.

HorsePunchKid’s picture

Title: Path components for [menupath] not separated correctly » Alias generated for [menupath] includes top-level menu
Status: Closed (duplicate) » Active

I have updated to the latest dev version from 2007-Sep-28, and I'm still seeing this behavior; the first component of the URL is primary-links. I'm not sure what I'm doing wrong, but no changes I make to pathauto_menu.inc seem to have any effect.

greggles’s picture

Project: Pathauto » Token
Version: 5.x-2.x-dev » 5.x-1.8
Status: Active » Postponed (maintainer needs more info)

No changes that you make to pathauto_menu.inc seem to help?

I'm not familiar with that file...

I just tried again and can't reproduce this.

This should really be a token module bug so I'm also moving this there...

HorsePunchKid’s picture

You're right! Do I have a bunch of files lying around in my pathauto directory that are no longer relevant?

This one-liner change to node_token_values() seems to fix the problem, though I have not tested it extensively:

--- token_node.inc      (revision 27)
+++ token_node.inc      (working copy)
@@ -59,6 +59,7 @@
       }
           
       if (isset($trail)) {
+        array_shift($trail);
         $values['menupath']     = implode('/', $trail);
         $values['menu']         = array_shift($trail);
       }
greggles’s picture

Status: Postponed (maintainer needs more info) » Active

Right, and in http://drupal.org/node/147132 we already took a step to solve this...

See http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/token/token... for the diff.

Can you confirm which revision of the token_node.inc file that you are using? Perhaps there is something wrong with the logic of "top level mid = 0"

If you can confirm under what conditions your problem comes up (maybe it's a custom menu?) then we can perhaps switch to the "remove the array_shift() idea.

greggles’s picture

Status: Active » Closed (duplicate)

Somewhere I feel like you agreed with me that this was fixed...irc, perhaps? Another issue?

Anyway - marking as a dup of that other issue.