Mix with Admin Toolbar not playing nicely

Created on 14 February 2023, almost 2 years ago
Updated 15 February 2023, almost 2 years ago

Problem/Motivation

When Mix and Admin Toolbar are both installed, cache clearing through Admin Toolbar "Flush all caches" link generates an error and the caches are not cleared.

This might be expected and better handling of this error might be needed.

This is the error produced.

TypeError: Argument 6 passed to Drupal\admin_toolbar_tools\Controller\ToolbarController::__construct() must implement interface Drupal\Core\Cache\CacheBackendInterface, instance of Drupal\mix\Cache\NullBackendFactory given, called in C:\xampp\htdocs\dev.spectrum.com.cy\web\modules\contrib\admin_toolbar\admin_toolbar_tools\src\Controller\ToolbarController.php on line 183 in Drupal\admin_toolbar_tools\Controller\ToolbarController->__construct() (line 139 of C:\xampp\htdocs\dev.spectrum.com.cy\web\modules\contrib\admin_toolbar\admin_toolbar_tools\src\Controller\ToolbarController.php)
#0 C:\xampp\htdocs\dev.spectrum.com.cy\web\modules\contrib\admin_toolbar\admin_toolbar_tools\src\Controller\ToolbarController.php(183): Drupal\admin_toolbar_tools\Controller\ToolbarController->__construct(Object(Drupal\Core\ProxyClass\Cron), Object(Drupal\Core\Menu\MenuLinkManager), Object(Drupal\Core\Menu\ContextualLinkManager), Object(Drupal\Core\Menu\LocalTaskManager), Object(Drupal\Core\Menu\LocalActionManager), Object(Drupal\mix\Cache\NullBackendFactory), Object(Drupal\Component\Datetime\Time), Object(Drupal\Core\Http\RequestStack), Object(Drupal\Core\ProxyClass\Plugin\CachedDiscoveryClearer), Object(Drupal\Core\Cache\DatabaseBackend), Object(Drupal\Core\Template\TwigEnvironment), Object(Drupal\Core\Theme\Registry))
#1 C:\xampp\htdocs\dev.spectrum.com.cy\web\core\lib\Drupal\Core\DependencyInjection\ClassResolver.php(28): Drupal\admin_toolbar_tools\Controller\ToolbarController::create(Object(Drupal\Core\DependencyInjection\Container))
#2 C:\xampp\htdocs\dev.spectrum.com.cy\web\core\lib\Drupal\Core\Controller\ControllerResolver.php(117): Drupal\Core\DependencyInjection\ClassResolver->getInstanceFromDefinition('\\Drupal\\admin_t...')
#3 C:\xampp\htdocs\dev.spectrum.com.cy\web\core\lib\Drupal\Core\Controller\ControllerResolver.php(69): Drupal\Core\Controller\ControllerResolver->createController('\\Drupal\\admin_t...')
#4 C:\xampp\htdocs\dev.spectrum.com.cy\web\core\lib\Drupal\Core\Controller\ControllerResolver.php(85): Drupal\Core\Controller\ControllerResolver->getControllerFromDefinition('\\Drupal\\admin_t...', '/admin/flush')
#5 C:\xampp\htdocs\dev.spectrum.com.cy\vendor\symfony\http-kernel\HttpKernel.php(152): Drupal\Core\Controller\ControllerResolver->getController(Object(Symfony\Component\HttpFoundation\Request))
#6 C:\xampp\htdocs\dev.spectrum.com.cy\vendor\symfony\http-kernel\HttpKernel.php(81): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#7 C:\xampp\htdocs\dev.spectrum.com.cy\web\core\lib\Drupal\Core\StackMiddleware\Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#8 C:\xampp\htdocs\dev.spectrum.com.cy\web\core\lib\Drupal\Core\StackMiddleware\KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#9 C:\xampp\htdocs\dev.spectrum.com.cy\web\core\modules\page_cache\src\StackMiddleware\PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#10 C:\xampp\htdocs\dev.spectrum.com.cy\web\core\modules\page_cache\src\StackMiddleware\PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#11 C:\xampp\htdocs\dev.spectrum.com.cy\web\core\lib\Drupal\Core\StackMiddleware\ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#12 C:\xampp\htdocs\dev.spectrum.com.cy\web\core\lib\Drupal\Core\StackMiddleware\NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#13 C:\xampp\htdocs\dev.spectrum.com.cy\vendor\stack\builder\src\Stack\StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#14 C:\xampp\htdocs\dev.spectrum.com.cy\web\core\lib\Drupal\Core\DrupalKernel.php(713): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#15 C:\xampp\htdocs\dev.spectrum.com.cy\web\index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#16 {main}

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024