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.

Comments

Berdir created an issue. See original summary.

berdir’s picture

Status: Active » Needs review
StatusFileSize
new2.03 KB
berdir’s picture

Wrong --relative.

The last submitted patch, 2: admin_toolbar-is-admin-menu-2925327-2.patch, failed testing. View results

adriancid’s picture

Hi @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

  • adriancid committed c6dc72d on 8.x-1.x authored by Berdir
    Issue #2925327 by Berdir, adriancid: Better check for is-link-in-admin-...
adriancid’s picture

Status: Needs review » Fixed
adriancid’s picture

Issue summary: View changes
StatusFileSize
new31.44 KB

Hi @Berdir, I notice that I have now Comments twice after apply your patch, can you check on your side?

berdir’s picture

Yeah, 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?

adriancid’s picture

That is actually a one-off workaround because adding local tasks to the menu is something that core doesn't do.

Yes, 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?

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.