Download & Extend

Use proper menu link loading for node menu links

Project:Token
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (duplicate)

Issue Summary

I am not sure if this is a pathauto issue or a token issue. I'm pretty sure it's not an admin_menu issue.

Modules
Drupal - 6.4
Pathauto - 6.x-2.x-dev 2008-Aug-13
Token - 6.x-1.x-dev 2008-Aug-02
admin_menu - 6.x-1.x-dev 2008-Aug-09

Steps to Reproduce

  1. Enable Pathauto
  2. Go to admin/build/path/pathauto
  3. Set the Pattern for all Page paths under node path settings to [menupath-raw]
  4. Save Configuration
  5. Create a new page
  • Title: Menu1
  • Menu link title: Menu1
  • Parent Item: Primary links
  • Save configuration
  • Link should be mysite.com/menu1
  • Go to admin/settings/site-information and set the homepage to node/1
  • Enable admin_menu
  • Go to node/1/edit
  • Click save configuration
  • Path is now the drupal icon path.
  • It seems when either pathauto or token looks for the menu path of the node it looks for node/1 and finds the admin_menu path for the homepage in the menu_links table which in this case is node/1 and link_title was the drupal icon image.

    Comments

    #1

    Here is the link to the pathauto issue: http://drupal.org/node/295179

    #2

    Looking at this it may not be fixable. I think the issue is another menu item with the same path can be created very easily and for now you have to take the first result on your menu_links query. I think the only way to fix this permanently is to change core so that the node table gets an assigned mlid if a user saves a node that has a menu. Then you will be able to get a nodes associated mlid.

    Does this sound about right?

    #3

    Here is a link to an issue for admin_menu to use the absolute path instead of the relative one to avoid conflicts.

    http://drupal.org/node/295476

    #4

    Version:6.x-1.x-dev» 6.x-1.11
    Priority:normal» critical

    Bumping to critical.

    As far as I understand, Token does not limit the result set of path aliases to system generated ones, resp. items a user has access to. Under certain conditions, this may lead to a wrong behavior of the menu system.

    Further information:
    #279767: User counter is output on login page for anonymous users
    #295476: admin_menu conflicts with pathauto
    #303247: Menu Breadcrumb setting active menu to undesirable menus
    #296534: Link paths are not unique

    #5

    subscribing...

    #6

    I can provide a tarball of a site with the #279767 error.

    #7

    Priority:critical» normal

    #8

    Status:active» postponed (maintainer needs more info)

    Can someone point out where the problem is with token and where we can fix it? I don't understand from any of the previous comments how this is a token problem and not an admin_menu problem.

    #9

    Status:postponed (maintainer needs more info)» active

    pwolanin described the underlying menu system/links issue at hand in #296534-1: Link paths are not unique

    I think that Token needs to limit the db result set for menu* tokens to menu links that were stored by module = 'menu', i.e., manually created menu links. Something like that, at least.

    #10

    Version:6.x-1.11» 6.x-1.x-dev
    Status:active» needs review

    Ah, in the D7 version, I'm loading via menu_node_prepare() which put precedence on the node's default menu and module = 'menu'.

    Please try this patch for Token 6.x-1.x-dev.

    AttachmentSizeStatusTest resultOperations
    295177-token-node-menu-load-D6.patch7.24 KBIgnored: Check issue status.NoneNone

    #11

    Title:Pathauto alias is not correct when using admin_menu» Use proper menu link loading for node menu links
    AttachmentSizeStatusTest resultOperations
    295177-token-node-menu-load-D6.patch3.15 KBIgnored: Check issue status.NoneNone

    #12

    We had a related issue maybe the patch below will fix this as well.

    http://drupal.org/node/854320

    #13

    Bookmarked - Thanks!

    #14

    Status:needs review» closed (duplicate)

    Merged this fix into #333590: Node menu token fails (node grants not saved yet, menu access checking, oh my!)

    nobody click here