Created on 20 April 2022, almost 3 years ago
Updated 21 February 2023, almost 2 years ago

When trying to activate the module on a machine with PHP 8.1 I am seeing the following:

TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, null given in method_exists() (line 224 of /home/sites/sitename/public_html/modules/contrib/menu_token/src/Service/TokenReplacer.php)

#0 /home/sites/sitename/public_html/modules/contrib/menu_token/src/Service/TokenReplacer.php(224): method_exists(NULL, 'isAnonymous')
#1 /home/sites/sitename/public_html/modules/contrib/menu_token/menu_token.module(328): Drupal\menu_token\Service\TokenReplacer->replaceExoticToken('[current-user:a...', 'account-name', Object(Drupal\Core\Render\BubbleableMetadata))
#2 [internal function]: menu_token_tokens('current-user', Array, Array, Array, Object(Drupal\Core\Render\BubbleableMetadata))
#3 /home/sites/sitename/public_html/core/lib/Drupal/Core/Extension/ModuleHandler.php(403): call_user_func_array('menu_token_toke...', Array)
#4 /home/sites/sitename/public_html/core/lib/Drupal/Core/Utility/Token.php(304): Drupal\Core\Extension\ModuleHandler->invokeAll('tokens', Array)
#5 /home/sites/sitename/public_html/core/lib/Drupal/Core/Utility/Token.php(196): Drupal\Core\Utility\Token->generate('current-user', Array, Array, Array, Object(Drupal\Core\Render\BubbleableMetadata))
#6 /home/sites/sitename/public_html/modules/contrib/menu_token/menu_token.module(342): Drupal\Core\Utility\Token->replace('Welcome [curren...', Array, Array, Object(Drupal\Core\Render\BubbleableMetadata))
#7 /home/sites/sitename/public_html/modules/contrib/menu_token/menu_token.module(406): replace_links_with_tokens(Object(Drupal\token\Token), 'title', Array, Array, Object(Drupal\Core\Render\BubbleableMetadata))
#8 /home/sites/sitename/public_html/core/lib/Drupal/Core/Extension/ModuleHandler.php(539): menu_token_menu_links_discovered_alter(Array, NULL, NULL)
#9 /home/sites/sitename/public_html/core/lib/Drupal/Core/Menu/MenuLinkManager.php(166): Drupal\Core\Extension\ModuleHandler->alter('menu_links_disc...', Array)
#10 /home/sites/sitename/public_html/core/lib/Drupal/Core/Menu/MenuLinkManager.php(189): Drupal\Core\Menu\MenuLinkManager->getDefinitions()
#11 /home/sites/sitename/public_html/core/lib/Drupal/Core/EventSubscriber/MenuRouterRebuildSubscriber.php(82): Drupal\Core\Menu\MenuLinkManager->rebuild()
#12 /home/sites/sitename/public_html/core/lib/Drupal/Core/EventSubscriber/MenuRouterRebuildSubscriber.php(70): Drupal\Core\EventSubscriber\MenuRouterRebuildSubscriber->menuLinksRebuild()
#13 [internal function]: Drupal\Core\EventSubscriber\MenuRouterRebuildSubscriber->onRouterRebuild(Object(Drupal\Component\EventDispatcher\Event), 'routing.route_f...', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#14 /home/sites/sitename/public_html/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(142): call_user_func(Array, Object(Drupal\Component\EventDispatcher\Event), 'routing.route_f...', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#15 /home/sites/sitename/public_html/core/lib/Drupal/Core/Routing/RouteBuilder.php(197): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object(Drupal\Component\EventDispatcher\Event), 'routing.route_f...')
#16 /home/sites/sitename/public_html/core/lib/Drupal/Core/ProxyClass/Routing/RouteBuilder.php(83): Drupal\Core\Routing\RouteBuilder->rebuild()
#17 /home/sites/sitename/public_html/core/lib/Drupal/Core/Extension/ModuleInstaller.php(382): Drupal\Core\ProxyClass\Routing\RouteBuilder->rebuild()
#18 /home/sites/sitename/public_html/core/lib/Drupal/Core/ProxyClass/Extension/ModuleInstaller.php(83): Drupal\Core\Extension\ModuleInstaller->install(Array, true)
#19 /home/sites/sitename/vendor/drush/drush/src/Drupal/Commands/pm/PmCommands.php(88): Drupal\Core\ProxyClass\Extension\ModuleInstaller->install(Array, true)
#20 [internal function]: Drush\Drupal\Commands\pm\PmCommands->install(Array, Array)
#21 /home/sites/sitename/vendor/consolidation/annotated-command/src/CommandProcessor.php(257): call_user_func_array(Array, Array)
#22 /home/sites/sitename/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback(Array, Object(Consolidation\AnnotatedCommand\CommandData))
#23 /home/sites/sitename/vendor/consolidation/annotated-command/src/CommandProcessor.php(176): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter(Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
#24 /home/sites/sitename/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(350): Consolidation\AnnotatedCommand\CommandProcessor->process(Object(Symfony\Component\Console\Output\ConsoleOutput), Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
#25 /home/sites/sitename/vendor/symfony/console/Command/Command.php(255): Consolidation\AnnotatedCommand\AnnotatedCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#26 /home/sites/sitename/vendor/symfony/console/Application.php(1027): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#27 /home/sites/sitename/vendor/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand(Object(Consolidation\AnnotatedCommand\AnnotatedCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#28 /home/sites/sitename/vendor/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#29 /home/sites/sitename/vendor/drush/drush/src/Runtime/Runtime.php(124): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#30 /home/sites/sitename/vendor/drush/drush/src/Runtime/Runtime.php(51): Drush\Runtime\Runtime->doRun(Array, Object(Symfony\Component\Console\Output\ConsoleOutput))
#31 /home/sites/sitename/vendor/drush/drush/drush.php(72): Drush\Runtime\Runtime->run(Array)
#32 /home/sites/sitename/vendor/drush/drush/includes/preflight.inc(18): require('/home/sites/pos...')
#33 phar:///usr/local/bin/drush/bin/drush.php(141): drush_main()
#34 /usr/local/bin/drush(10): require('phar:///usr/loc...')
#35 {main}

🐛 Bug report
Status

Fixed

Version

9.1

Component

Code

Created by

🇺🇸United States Christopher Riley

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024