Problem/Motivation
Notice: Undefined index: url in ./modules/contrib/admin_toolbar/admin_toolbar_tools/admin_toolbar_tools.module on line 604

Proposed resolution
Instantiate url key/value pair in array.

Steps to reproduce error
Clear the cache in drupal console.

Comments

pmuzyk created an issue. See original summary.

adriancid’s picture

Hi @pmuzyk, thanks for reporting, can you add the steps to reproduce the issue please?

gigapat’s picture

Simply clear the cache using drupal console

gigapat’s picture

Issue summary: View changes
adriancid’s picture

I can't reproduce the issue, please update the description with Drupal version and modules installed.

See: text

adriancid’s picture

Status: Active » Postponed (maintainer needs more info)
dtv_rb’s picture

Same problem.

I get the notice when I click on "Flush all caches" in admin tool bar drop down.

----------

Notice: Undefined index: menu_link_content:c91c0552-4c63-4b7b-bd15-cb51d5fb4f34 in admin_toolbar_tools_menu_links_discovered_alter() (line 600 of modules/contrib/admin_toolbar/admin_toolbar_tools/admin_toolbar_tools.module).

admin_toolbar_tools_menu_links_discovered_alter(Array, NULL, NULL) (Line: 501)
Drupal\Core\Extension\ModuleHandler->alter('menu_links_discovered', Array) (Line: 167)
Drupal\Core\Menu\MenuLinkManager->getDefinitions() (Line: 190)
Drupal\Core\Menu\MenuLinkManager->rebuild() (Line: 61)
Drupal\Core\EventSubscriber\MenuRouterRebuildSubscriber->menuLinksRebuild() (Line: 49)
Drupal\Core\EventSubscriber\MenuRouterRebuildSubscriber->onRouterRebuild(Object, 'routing.route_finished', Object) (Line: 108)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('routing.route_finished', Object) (Line: 192)
Drupal\Core\Routing\RouteBuilder->rebuild() (Line: 83)
Drupal\Core\ProxyClass\Routing\RouteBuilder->rebuild() (Line: 1142)
drupal_flush_all_caches() (Line: 145)
Drupal\admin_toolbar_tools\Controller\ToolbarController->flushAll()
call_user_func_array(Array, Array) (Line: 123)

adriancid’s picture

Hi @dtv_rb I have the module installed in Drupal 8.3.7 and Drupal 8.4 and is working fine, can you show the modules that you have installed and the Drupal version?

adriancid’s picture

@dtv_rb can you test the patch submitted in #2925327: Better check for is-link-in-admin-menu for local task links to see if fix the problem?

dtv_rb’s picture

@adriancid

The patch didn't fix the problem. Same Error:

Notice: Undefined index: menu_link_content:c91c0552-4c63-4b7b-bd15-cb51d5fb4f34 in admin_toolbar_tools_menu_links_discovered_alter() (line 626 of modules/contrib/admin_toolbar/admin_toolbar_tools/admin_toolbar_tools.module).

Drupal Version 8.4.2

Modules

{
        "drupal-composer/drupal-scaffold": "^2.0.1",
        "drupal/admin_toolbar": "^1.21",
        "drupal/advagg": "^3.4",
        "drupal/ajax_loader": "^1.3",
        "drupal/allowed_formats": "^1.1",
        "drupal/block_exclude_pages": "^1.2",
        "drupal/captcha": "^1.0@beta",
        "drupal/cdn": "^3.1",
        "drupal/ckeditor_media_embed": "^1.1",
        "drupal/ckeditor_smiley": "^1.0",
        "drupal/ckwordcount": "^1.0",
        "drupal/comment_delete": "^1.0",
        "drupal/console": "~1.0",
        "drupal/core": "~8.0",
        "drupal/country": "^1.0@beta",
        "drupal/ctools": "^3.0",
        "drupal/facets": "^1.0@alpha",
        "drupal/flag": "^4.0@alpha",
        "drupal/honeypot": "^1.27",
        "drupal/mailsystem": "^4.1",
        "drupal/message": "^1.0@beta",
        "drupal/metatag": "^1.1",
        "drupal/minifyhtml": "^1.1",
        "drupal/notification": "^1.0",
        "drupal/pathauto": "^1.0",
        "drupal/recaptcha": "^2.2",
        "drupal/redirect": "^1.0@alpha",
        "drupal/redis": "^1.0@beta",
        "drupal/search_api": "^1.2",
        "drupal/search_api_solr": "^1.0",
        "drupal/search_api_sorts": "^1.0@beta",
        "drupal/simplenews": "^1.0@alpha",
        "drupal/social_login": "^1.6",
        "drupal/swiftmailer": "^1.0@beta",
        "drupal/taxonomy_unique": "^2.0",
        "drupal/token": "^1.0",
        "drupal/twig_tweak": "^1.8",
        "drupal/views_custom_cache_tag": "^1.0",
        "drupal/views_infinite_scroll": "^1.3",
        "drupal/webform": "^5.0@beta",
        "drush/drush": "~8.0",
        "drupal/shield": "^1.1",
        "drupal/blackfire": "1.x-dev"
    }
lamp5’s picture

I have got similar error after update to the latest version, but with Custom Menu Links Visibility module. After debug i can confirm that all links from "Flush all cache" menu tab losts own "original_link" and "below" index.

Notice: Undefined index: original_link in _menu_link_content_visibility_preprocess_menu_item_is_visible()
Notice: Undefined index: below in _menu_link_content_visibility_preprocess_menu_items() 
rwam’s picture

Priority: Minor » Normal
Status: Postponed (maintainer needs more info) » Needs work

Same problem here with Menu Link Attributes and this patch. I get Notice: Undefined index: original_link in … too.

I think the problem is situated in …/admin_toolbar/admin_toolbar_tools/src/ToolbarHandler.php:createMenuRenderArray because it creates a render array without original_link key.

I change priority because of several issues like #2925196 or #2925560.

adriancid’s picture

Status: Needs work » Active
adriancid’s picture

Hi to @all, thanks for your patient and for report the issue with this problematic new version, sorry for this but the module was really working for me and for the others maintainers before the last release, even for other users that test the module before the new release.

As we can't reproduce all the issues reported in the new release version and as it seems that they comes from #2897309: admin_toolbar_tools module makes all pages uncacheable we have removed the code from the actual dev version and we need your help (as you can see the error, but we can't reproduce the issue) to know if now the module is working fine. So please install the latest dev version and provide some feedback about this issue.

As it seems that is a problem with the cache is better handle the problem in #2925501: Menu does not take changes into account (caching issue).

Our sincere apologies and thanks for helping us to improve this module so used by the community.

adriancid’s picture

Somebody can confirm that this is solved in the actual dev?

As I'm not able to reproduce this issue I need a help from us. We are planning a new release in this days.

rwam’s picture

Hi @adriancid,

I've tested current dev version and can confirm, that the bug is solved for my usecase.

Ciao
Ralf

adriancid’s picture

Status: Active » Closed (duplicate)

Closing as duplicate of #2925501: Menu does not take changes into account (caching issue). The credit will be provided in this issue.

Thanks @rwam