PHP Fatal error: Uncaught TypeError

Created on 25 July 2023, over 1 year ago

Problem/Motivation

D 9.5.10, PHP 8.1.20 - Would like to use the module with its fine function but 'drush cr' crashes as described below.

Steps to reproduce

Upgraded Admin Toolbar Version from 1.0.3 to 1.0.4 and got this:

Fatal error: Uncaught TypeError: Drupal\admin_toolbar_version\VersionInfoManager::getEnvironmentConfig(): Return value must be of type array, bool returned in /var/www/html/web/modules/contrib/admin_toolbar_version/src/VersionInfoManager.php:226
Stack trace:
#0 /var/www/html/web/modules/contrib/admin_toolbar_version/src/VersionInfoManager.php(142): Drupal\admin_toolbar_version\VersionInfoManager->getEnvironmentConfig()
#1 /var/www/html/web/modules/contrib/admin_toolbar_version/src/VersionInfoManager.php(177): Drupal\admin_toolbar_version\VersionInfoManager->getEnvironment()
#2 /var/www/html/web/modules/contrib/admin_toolbar_version/admin_toolbar_version.module(51): Drupal\admin_toolbar_version\VersionInfoManager->getStyle()
#3 /var/www/html/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(562): admin_toolbar_version_menu_links_discovered_alter()
#4 /var/www/html/web/core/lib/Drupal/Core/Menu/MenuLinkManager.php(166): Drupal\Core\Extension\ModuleHandler->alter()
#5 /var/www/html/web/core/lib/Drupal/Core/Menu/MenuLinkManager.php(189): Drupal\Core\Menu\MenuLinkManager->getDefinitions()
#6 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/MenuRouterRebuildSubscriber.php(82): Drupal\Core\Menu\MenuLinkManager->rebuild()
#7 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/MenuRouterRebuildSubscriber.php(70): Drupal\Core\EventSubscriber\MenuRouterRebuildSubscriber->menuLinksRebuild()
#8 [internal function]: Drupal\Core\EventSubscriber\MenuRouterRebuildSubscriber->onRouterRebuild()
#9 /var/www/html/web/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(142): call_user_func()
#10 /var/www/html/web/core/lib/Drupal/Core/Routing/RouteBuilder.php(197): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch()
#11 /var/www/html/web/core/lib/Drupal/Core/ProxyClass/Routing/RouteBuilder.php(83): Drupal\Core\Routing\RouteBuilder->rebuild()
#12 /var/www/html/web/core/includes/common.inc(587): Drupal\Core\ProxyClass\Routing\RouteBuilder->rebuild()
#13 /var/www/html/web/core/includes/utility.inc(41): drupal_flush_all_caches()
#14 /var/www/html/vendor/drush/drush/src/Commands/core/CacheCommands.php(228): drupal_rebuild()
#15 [internal function]: Drush\Commands\core\CacheCommands->rebuild()
#16 /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php(276): call_user_func_array()
#17 /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback()
#18 /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php(176): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter()
#19 /var/www/html/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(391): Consolidation\AnnotatedCommand\CommandProcessor->process()
#20 /var/www/html/vendor/symfony/console/Command/Command.php(255): Consolidation\AnnotatedCommand\AnnotatedCommand->execute()
#21 /var/www/html/vendor/symfony/console/Application.php(1039): Symfony\Component\Console\Command\Command->run()
#22 /var/www/html/vendor/symfony/console/Application.php(275): Symfony\Component\Console\Application->doRunCommand()
#23 /var/www/html/vendor/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun()
#24 /var/www/html/vendor/drush/drush/src/Runtime/Runtime.php(124): Symfony\Component\Console\Application->run()
#25 /var/www/html/vendor/drush/drush/src/Runtime/Runtime.php(51): Drush\Runtime\Runtime->doRun()
#26 /var/www/html/vendor/drush/drush/drush.php(79): Drush\Runtime\Runtime->run()
#27 /var/www/html/vendor/drush/drush/includes/preflight.inc(18): require('...')
#28 phar:///usr/local/bin/drush/bin/drush.php(143): drush_main()
#29 /usr/local/bin/drush(14): require('...')
#30 {main}
thrown in /var/www/html/web/modules/contrib/admin_toolbar_version/src/VersionInfoManager.php on line 226
[warning] Drush command terminated abnormally.

Proposed resolution

none

🐛 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