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.
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
Comment #1
HorsePunchKid CreditAttribution: HorsePunchKid commentedArgh, 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.Comment #2
gregglesGood to know.
If you update to the dev version of token then your menupath problem should be fixed as well.
Comment #3
HorsePunchKid CreditAttribution: HorsePunchKid commentedI 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 topathauto_menu.inc
seem to have any effect.Comment #4
gregglesNo 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...
Comment #5
HorsePunchKid CreditAttribution: HorsePunchKid commentedYou'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:Comment #6
gregglesRight, 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.
Comment #7
gregglesSomewhere I feel like you agreed with me that this was fixed...irc, perhaps? Another issue?
Anyway - marking as a dup of that other issue.