The check that I added at the end in #2731369: Local tasks don't show in the toolbar isn't complete. As I found out, if not set, then the menu is inherited from the parent.
The approach in this patch traverses through the parents to find out if they are in the admin menu or not.
This fixes views local tasks on /admin/content for me.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | admin_toolbar-is-admin-menu-2925327-2.patch | 1.92 KB | berdir |
| #2 | admin_toolbar-is-admin-menu-2925327-2.patch | 2.03 KB | berdir |
Comments
Comment #2
berdirComment #3
berdirWrong --relative.
Comment #5
adriancidHi @Berdir, thanks for the patch, this is related to the following issues?
#2925145: Notice: Undefined index: url
#2925136: Loss of dropdown when enabling admin_toolbar_tools
Comment #7
adriancidComment #8
adriancidHi @Berdir, I notice that I have now Comments twice after apply your patch, can you check on your side?
Comment #9
berdirYeah, that's tricky because core that defines that *both* as a local task and a menu link, see comment.links.menu.yml and comment.links.task.yml.
That is actually a one-off workaround because adding local tasks to the menu is something that core doesn't do.
Maybe we could either add a specific check for this or a more generic duplicate check?
Comment #10
adriancidYes, I just see this in Routes node.add.CONTENT_TYPE are no longer available starting from Drupal 8.4 in hook_menu_links_discovered_alter()?
Maybe we need to create an issue for Drupal about this? And add a workaround until the issue will be solved?