Problem/Motivation

Activating gin_toolbar without admin_toolbar produces the following error:
InvalidArgumentException: Class "toolbar_tools_menu_navigation_links" does not exist. in Drupal\Core\DependencyInjection\ClassResolver->getInstanceFromDefinition() (line 24 of core/lib/Drupal/Core/DependencyInjection/ClassResolver.php).

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

chr.fritsch created an issue. See original summary.

chr.fritsch’s picture

Status: Active » Needs review

Fix pushed to branch

volkerk’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community
StatusFileSize
new53.82 KB

The mr fixes the exception.

Using the gin toolbar without admin_toolbar is not very satisfactionable, markup looks rather broken without icon classes, maybe add a dependency (could be a follow-up)?

Screenshot of gin toolbar in bartik without icon classes

saschaeggi made their first commit to this issue’s fork.

saschaeggi’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new112.4 KB

Can you review this again with latest devs of Gin & Gin Toolbar?
Even without this change and without admin_toolbar it looks good to me.
See
Gin Toolbar

ambient.impact’s picture

Hi there. I'm getting the exact same error when upgrading from 1.0.0-beta14 to 1.0.0-beta15, but on a project that I've never installed contrib Admin Toolbar module (just the core Toolbar module).

Full error:

The website encountered an unexpected error. Please try again later.

InvalidArgumentException: Class "toolbar_tools_menu_navigation_links" does not exist. in Drupal\Core\DependencyInjection\ClassResolver->getInstanceFromDefinition() (line 24 of core\lib\Drupal\Core\DependencyInjection\ClassResolver.php).

Drupal\Core\Controller\ControllerResolver->getControllerFromDefinition('toolbar_tools_menu_navigation_links') (Line: 140)
Drupal\Core\Menu\MenuLinkTree->transform(Array, Array) (Line: 58)
Drupal\gin_toolbar\Render\Element\GinToolbar::preRenderTray(Array)
call_user_func_array(Array, Array) (Line: 100)
Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_render callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was %s. Support for this callback implementation is deprecated in 8.8.0 and will be removed in Drupal 9.0.0. See https://www.drupal.org/node/2966725', 'silenced_deprecation', 'Drupal\Core\Render\Element\RenderCallbackInterface') (Line: 781)
Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array) (Line: 372)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 444)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 444)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 200)
Drupal\Core\Render\Renderer->render(Array) (Line: 93)
template_preprocess_toolbar(Array, 'toolbar', Array) (Line: 287)
Drupal\Core\Theme\ThemeManager->render('toolbar', Array) (Line: 431)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 444)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 200)
Drupal\Core\Render\Renderer->render(Array) (Line: 501)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 98)
__TwigTemplate_b577d186f6fd849d55a8ef0538fc7c076ba1143ff41ed668d3385f1e5fa09d9d->doDisplay(Array, Array) (Line: 455)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 422)
Twig\Template->display(Array) (Line: 434)
Twig\Template->render(Array) (Line: 64)
twig_render_template('themes/contrib/gin/templates/html.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('html', Array) (Line: 431)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 200)
Drupal\Core\Render\Renderer->render(Array) (Line: 147)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 573)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 148)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object)
call_user_func(Array, Object, 'kernel.view', Object) (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.view', Object) (Line: 156)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 49)
Drupal\remove_http_headers\StackMiddleware\RemoveHttpHeadersMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 708)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
saschaeggi’s picture

@Ambient.Impact can you confirm that the provided patch will solve this for you?
=> https://git.drupalcode.org/project/gin_toolbar/-/merge_requests/7.patch

ambient.impact’s picture

The patch does indeed fix the WSOD, but applying to both the stable release and the latest dev results in the same missing icons as in #4.

saschaeggi’s picture

@Ambient.Impact => latest patch from MR (https://git.drupalcode.org/project/gin_toolbar/-/merge_requests/7.patch) should fix the issue now.

ambient.impact’s picture

@saschaeggi That does appear to fix it, thanks!

saschaeggi’s picture

Status: Needs review » Fixed

Thanks y'all!

ambient.impact’s picture

Status: Fixed » Needs review
ambient.impact’s picture

Status: Needs review » Fixed

Whoops. My bad. 😅

Status: Fixed » Closed (fixed)

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

ambient.impact’s picture

I noticed that this item wasn't included in the change log for the latest version, but the patch was failing to apply, so I assume the fix is in the released version hence the failing patch. If anyone else runs into this - just remove the patch as it's no longer needed.