Closed (outdated)
Project:
Drupal core
Version:
8.9.x-dev
Component:
menu system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
9 Nov 2011 at 22:37 UTC
Updated:
3 Oct 2021 at 01:15 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
chx commentedNote that menu_get_item will still use $_GET['q'] but that's the only one. This makes menu_set_active_item actually work.
Comment #3
aspilicious commentedThis is blocking a wscci patch.
Thnx chx for working on this.
Comment #4
sunmenu_*s*et_item() in the first?
I realize it makes no difference currently, but for API usage intentions' sake...?
Comment #5
aspilicious commentedLets try this one.
Don't mind the name, just to trigger the testbot
Comment #7
aspilicious commentedSecond try
Comment #8
chx commentedI inlined menu_set_item for speed...
Comment #10
aspilicious commentedOk backtraced the error. It's not a shortcut issue it's a page not found issue.
Menu_get_item(); returns false after this :)
Comment #11
chx commentedThat's only possible really if you dont have access to the $path or it's an invalid $path in the first place.
Comment #12
aspilicious commentedI'll try to print $path
Comment #13
aspilicious commentedOk I spend some hours on backtracking this
So I'm going to summarize now, I have no ide how to fix this.
1) When visiting 'site.com/page-that-does-not-exist' MENU_NOT_FOUND gets triggered in drupal_deliver_html_page // common.inc
2) It does some stuff and than the page gets passed to drupal_render // common.inc
3) Somewhere in drupal render toolbar_pre_render() gets called // toolbar.module
4) If you go a few levels deeper toolbar_in_active_trail() gets called // toolbar.module
5) That function calls menu_get_active_trail() // menu.inc
If you call menu_get_item in menu_get_active_trail it returns false. ==> fail
Comment #14
chx commentedThis ties into #1299056: Remove misnamed and useless menu_set_active_trail() function.
This is like a spectacular mess. To the best my understanding, there is a current router path but there is another path which we want menu links to think we are on. We have an ass-amount of setters and getters around these, completely lost at purpose and direction. We need to clean house very seriously.
Comment #15
chx commentedI discussed with sun who pointed out that the preferred link defaults to FALSE. So I have rolled this patch with 4 lines of context because it's nicely visible so.
Comment #16
sun- Added comment for inlined menu_set_item().
- Added 'original_href' directly in menu_get_item().
Comment #17
sun- Replaced that implode() with simply $path.
Comment #18
sunProvide original_href to _menu_translate() already.
Comment #19
pwolanin commentedsure, the fewer direct references to $_GET the better
Comment #20
aspilicious commentedChanging title
Comment #21
xjmTangentially related: #1811792: drupal_set_title() should not be necessary to set the homepage title
Comment #22
areke commentedThe patch needs to be re-rolled as it doesn't apply anymore
Comment #23
pwolanin commentedShould wait until #2047633: Move definition of menu links to hook_menu_link_defaults(), decouple key name from path, and make 'parent' explicit is done
Comment #24
miraj9093 commentedpatch re-rolled ! I am updating this issue after long time , some changes making the patch bigger in size.
Comment #25
miraj9093 commentedi think its right time to work on this issue now..
Comment #26
dawehnerNote: We would actually have to convert this function to use a route name + route parameters instead of using a path.
Comment #27
miraj9093 commentedComment #36
quietone commentedThe menu link system was changed in #2256521: [META] New plan, Phase 2: Implement menu links as plugins, including static admin links and views, and custom links with menu_link_content entity, all managed via menu_ui module and child issues in 2014.
Therefore, closing as outdated. If this is incorrect reopen the issue, by setting the status to 'Active', and add a comment explaining what still needs to be done.
Thanks!
Comment #37
quietone commented