Unable to add token in menu path

Created on 18 March 2015, almost 10 years ago
Updated 15 September 2023, over 1 year ago

Hai,

I created a profile by using profile2 module. I want to user navigate to directly to edit area to edit his profile. So I used menu token module.

But I am unable to add token in menu path. I tried all options in given area. I am getting following message, please check it.

The path 'menutoken/5509ac7dcda1a' is either invalid or you do not have access to it.

🐛 Bug report
Status

Closed: outdated

Version

1.0

Component

Code

Created by

🇮🇳India Sreenivas Bttv

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇺🇸United States ron_s

    I won't open this issue because it says Drupal 7 is no longer supported, but there are a couple of bugs in the menu_token_handler validation function for 7.x-1.x-dev.

    First problem is a typo. The code for $link_path_tokens was copied for $link_title_tokens, and clearly forgot to update one of the variables. The code says this:

    $link_title_tokens = array_intersect($link_path_tokens, $entities);
    

    ... and it should be this:

    $link_title_tokens = array_intersect($link_title_tokens, $entities);
    

    The second issue is extra tokens that have a type of node or user are considered invalid. A perfect example is mentioned in comment #3. The token current-user is a completely valid user-type token, but the code only allows a user token if its type is set exactly to user.

    I wrote a patch that fixes the typo and passes validation for any token that are of type "user" or "node". If any interest, see attached.

Production build 0.71.5 2024