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.
Menu links never actually link to the full path of a MENU_DEFAULT_LOCAL_TASK, only its parent.
/admin/structure/views <-- Parent
/admin/structure/views/basic <-- Default local task
/admin/structure/views/advanced <-- Local task
As a part of #1995620: [policy, no patch] Document how to handle routes for MENU_DEFAULT_LOCAL_TASK, we're considering making the actual default local task path 404.
I'm not 100% sure if #914382: Contextual links incompatible with render cache changed this, but it certainly makes it harder to track down.
I believe that the db_select() in menu_contextual_links() is actually the issue.
Comment | File | Size | Author |
---|---|---|---|
#5 | menu-contextual-2006636-5.patch | 3.71 KB | tim.plunkett |
#4 | menu-2006636-4.patch | 677 bytes | tim.plunkett |
Comments
Comment #1
tim.plunkettThe query in question is this:
Comment #2
dawehnerWhat about something like
Comment #3
Wim Leers#914382: Contextual links incompatible with render cache didn't touch
menu_contextual_links()
:)Comment #4
tim.plunkettI spent a good deal of time with this, and I'm not sure if it's possible with a single query.
What we want are all local tasks, and the parent task only when it has a default local task, and only when only none of the local tasks have MENU_CONTEXT_NONE or MENU_CONTEXT_PAGE.
But all parents have MENU_CONTEXT_NONE, and it's hard to know if they have a child MENU_DEFAULT_LOCAL_TASK.
So, this is easier.
However, this is going to break a lot of tests, but all of the ones that break are violating #1995620: [policy, no patch] Document how to handle routes for MENU_DEFAULT_LOCAL_TASK anyway, so we can just fix them.
Comment #5
tim.plunkettActually, this shouldn't be a big problem. We don't need to change all the asserts, just the contextual link ones.
Comment #6
chx CreditAttribution: chx commentedThe default local task path is never used AFAIK so if it is used then it's a bug. I wonder whether this is backportable too.
Comment #7
alexpottCommitted ace3459 and pushed to 8.x. Thanks!
Let the backport discussion begin :)
Comment #8
dawehnerNice!
Comment #9
dawehnerI'm to slow.
Comment #10
Crell CreditAttribution: Crell commentedNo WSCCI tag needed for D7.
Comment #11
bhide.nishad CreditAttribution: bhide.nishad at Clarion Technologies commentedComment #14
bhide.nishad CreditAttribution: bhide.nishad at Clarion Technologies commented