TypeError Unsupported operand types int + string in Drupal\admin_toolbar_tools

Created on 8 August 2025, 4 days ago

Problem/Motivation

When upgrading to D 11.2.3 I get this on drush updb:

TypeError: Unsupported operand types: int + string in Drupal\admin_toolbar_tools\Plugin\Derivative\ExtraLinks->getDerivativeDefinitions() (line 749

drush updb
 [warning] Drupal requires databases that support JSON storage.
 (Currently using Database support for JSON Available
)
 [warning] Package Manager is available for early testing. To install the module set the
value of 'testing_package_manager' to TRUE in your settings.php file.


 โ”Œ Requirements check reports errors. Do you wish to continue? โ”€โ”
 โ”‚ Yes                                                          โ”‚
 โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

 ----------------- --------------- ------------- ----------------------------
  Module            Update ID       Type          Description
 ----------------- --------------- ------------- ----------------------------
  project_browser   convert_enabl   post-update   Updates Project Browser
                    ed_sources_to                 settings to support
                    _arrays                       source-specific
                                                  configuration.
  project_browser   rebuild_conta   post-update   Clears the cache so that
                    iner_for_oo_h                 Project Browser's OO hooks
                    ooks                          are registered.
 ----------------- --------------- ------------- ----------------------------


 โ”Œ Do you wish to run the specified pending updates? โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
 โ”‚ Yes                                                          โ”‚
 โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

>  [notice] Update started: project_browser_post_update_convert_enabled_sources_to_arrays
>  [notice] Update completed: project_browser_post_update_convert_enabled_sources_to_arrays
>  [notice] Update started: project_browser_post_update_rebuild_container_for_oo_hooks
>  [notice] Update completed: project_browser_post_update_rebuild_container_for_oo_hooks
 [success] Finished performing updates.
 [warning] Array to string conversion ExtraLinks.php:745
 [error]  TypeError: Unsupported operand types: int + string in Drupal\admin_toolbar_tools\Plugin\Derivative\ExtraLinks->getDerivativeDefinitions() (line 749 of /.../modules/contrib/admin_toolbar/admin_toolbar_tools/src/Plugin/Derivative/ExtraLinks.php) #0 /.../core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php(101): Drupal\admin_toolbar_tools\Plugin\Derivative\ExtraLinks->getDerivativeDefinitions()
#1 /.../core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php(87): Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDerivatives()
#2 /.../core/lib/Drupal/Core/Menu/MenuLinkManager.php(127): Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDefinitions()
#3 /.../core/lib/Drupal/Core/Menu/MenuLinkManager.php(152): Drupal\Core\Menu\MenuLinkManager->getDefinitions()
#4 /.../core/lib/Drupal/Core/EventSubscriber/MenuRouterRebuildSubscriber.php(62): Drupal\Core\Menu\MenuLinkManager->rebuild()
#5 /.../core/lib/Drupal/Core/EventSubscriber/MenuRouterRebuildSubscriber.php(50): Drupal\Core\EventSubscriber\MenuRouterRebuildSubscriber->menuLinksRebuild()
#6 /var/www/vendor/symfony/event-dispatcher/EventDispatcher.php(246): Drupal\Core\EventSubscriber\MenuRouterRebuildSubscriber->onRouterRebuild()
#7 /var/www/vendor/symfony/event-dispatcher/EventDispatcher.php(206): Symfony\Component\EventDispatcher\EventDispatcher::Symfony\Component\EventDispatcher\{closure}()
#8 /var/www/vendor/symfony/event-dispatcher/EventDispatcher.php(56): Symfony\Component\EventDispatcher\EventDispatcher->callListeners()
#9 /.../core/lib/Drupal/Core/Routing/RouteBuilder.php(209): Symfony\Component\EventDispatcher\EventDispatcher->dispatch()
#10 /.../core/lib/Drupal/Core/ProxyClass/Routing/RouteBuilder.php(83): Drupal\Core\Routing\RouteBuilder->rebuild()
#11 /.../core/includes/common.inc(473): Drupal\Core\ProxyClass\Routing\RouteBuilder->rebuild()
#12 /var/www/vendor/drush/drush/src/Commands/core/UpdateDBCommands.php(96): drupal_flush_all_caches()
#13 [internal function]: Drush\Commands\core\UpdateDBCommands->updatedb()
#14 /var/www/vendor/consolidation/annotated-command/src/CommandProcessor.php(276): call_user_func_array()
#15 /var/www/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback()
#16 /var/www/vendor/consolidation/annotated-command/src/CommandProcessor.php(175): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter()
#17 /var/www/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(387): Consolidation\AnnotatedCommand\CommandProcessor->process()
#18 /var/www/vendor/symfony/console/Command/Command.php(318): Consolidation\AnnotatedCommand\AnnotatedCommand->execute()
#19 /var/www/vendor/symfony/console/Application.php(1092): Symfony\Component\Console\Command\Command->run()
#20 /var/www/vendor/symfony/console/Application.php(341): Symfony\Component\Console\Application->doRunCommand()
#21 /var/www/vendor/symfony/console/Application.php(192): Symfony\Component\Console\Application->doRun()
#22 /var/www/vendor/drush/drush/src/Runtime/Runtime.php(110): Symfony\Component\Console\Application->run()
#23 /var/www/vendor/drush/drush/src/Runtime/Runtime.php(40): Drush\Runtime\Runtime->doRun()
#24 /var/www/vendor/drush/drush/drush.php(140): Drush\Runtime\Runtime->run()
#25 /var/www/vendor/bin/drush.php(119): include('...')
#26 {main}.
TypeError: Unsupported operand types: int + string in /.../modules/contrib/admin_toolbar/admin_toolbar_tools/src/Plugin/Derivative/ExtraLinks.php on line 749 #0 /.../core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php(101): Drupal\admin_toolbar_tools\Plugin\Derivative\ExtraLinks->getDerivativeDefinitions()
#1 /.../core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php(87): Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDerivatives()
#2 /.../core/lib/Drupal/Core/Menu/MenuLinkManager.php(127): Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDefinitions()
#3 /.../core/lib/Drupal/Core/Menu/MenuLinkManager.php(152): Drupal\Core\Menu\MenuLinkManager->getDefinitions()
#4 /.../core/lib/Drupal/Core/EventSubscriber/MenuRouterRebuildSubscriber.php(62): Drupal\Core\Menu\MenuLinkManager->rebuild()
#5 /.../core/lib/Drupal/Core/EventSubscriber/MenuRouterRebuildSubscriber.php(50): Drupal\Core\EventSubscriber\MenuRouterRebuildSubscriber->menuLinksRebuild()
#6 /var/www/vendor/symfony/event-dispatcher/EventDispatcher.php(246): Drupal\Core\EventSubscriber\MenuRouterRebuildSubscriber->onRouterRebuild()
#7 /var/www/vendor/symfony/event-dispatcher/EventDispatcher.php(206): Symfony\Component\EventDispatcher\EventDispatcher::Symfony\Component\EventDispatcher\{closure}()
#8 /var/www/vendor/symfony/event-dispatcher/EventDispatcher.php(56): Symfony\Component\EventDispatcher\EventDispatcher->callListeners()
#9 /.../core/lib/Drupal/Core/Routing/RouteBuilder.php(209): Symfony\Component\EventDispatcher\EventDispatcher->dispatch()
#10 /.../core/lib/Drupal/Core/ProxyClass/Routing/RouteBuilder.php(83): Drupal\Core\Routing\RouteBuilder->rebuild()
#11 /.../core/includes/common.inc(473): Drupal\Core\ProxyClass\Routing\RouteBuilder->rebuild()
#12 /var/www/vendor/drush/drush/src/Commands/core/UpdateDBCommands.php(96): drupal_flush_all_caches()
#13 [internal function]: Drush\Commands\core\UpdateDBCommands->updatedb()
#14 /var/www/vendor/consolidation/annotated-command/src/CommandProcessor.php(276): call_user_func_array()
#15 /var/www/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback()
#16 /var/www/vendor/consolidation/annotated-command/src/CommandProcessor.php(175): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter()
#17 /var/www/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(387): Consolidation\AnnotatedCommand\CommandProcessor->process()
#18 /var/www/vendor/symfony/console/Command/Command.php(318): Consolidation\AnnotatedCommand\AnnotatedCommand->execute()
#19 /var/www/vendor/symfony/console/Application.php(1092): Symfony\Component\Console\Command\Command->run()
#20 /var/www/vendor/symfony/console/Application.php(341): Symfony\Component\Console\Application->doRunCommand()
#21 /var/www/vendor/symfony/console/Application.php(192): Symfony\Component\Console\Application->doRun()
#22 /var/www/vendor/drush/drush/src/Runtime/Runtime.php(110): Symfony\Component\Console\Application->run()
#23 /var/www/vendor/drush/drush/src/Runtime/Runtime.php(40): Drush\Runtime\Runtime->doRun()
#24 /var/www/vendor/drush/drush/drush.php(140): Drush\Runtime\Runtime->run()
#25 /var/www/vendor/bin/drush.php(119): include('...')
#26 {main}
TypeError: Unsupported operand types: int + string in Drupal\admin_toolbar_tools\Plugin\Derivative\ExtraLinks->getDerivativeDefinitions() (line 749 of /.../modules/contrib/admin_toolbar/admin_toolbar_tools/src/Plugin/Derivative/ExtraLinks.php).
 [warning] Drush command terminated abnormally.

I don't know if these are of any help:
https://www.drupal.org/project/entity_update/issues/3342851 ๐Ÿ› Error: Unsupported operand types: string - int in Drupal\entity_update\EntityUpdatePrint::drushPrintTable() Fixed

https://www.drupal.org/project/smart_date/issues/3443532 ๐Ÿ› TypeError: Unsupported operand types: string + int in Drupal\smart_date\Plugin\migrate\process\ParseDates->transform() Needs review

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

๐Ÿ› Bug report
Status

Active

Version

3.6

Component

Code

Created by

๐Ÿ‡ฆ๐Ÿ‡นAustria maxilein

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

Comments & Activities

  • Issue created by @maxilein
  • ๐Ÿ‡ฆ๐Ÿ‡นAustria maxilein
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia vinodhini.e chennai

    vinodhini.e โ†’ made their first commit to this issueโ€™s fork.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia vinodhini.e chennai

    Hi @maxilein,
    Steps to Reproduce (Unable to Replicate the Issue):
    1. Upgraded Drupal core from 11.2.2 to 11.2.3.
    2. Ran database updates using: drush updb
    3. The update ran successfully without any errors. Unable to reproduce the reported issue.

    Could you please provide more details or specific steps so I can attempt to reproduce the issue on my setup?

  • Hi @maxilein,

    Here is a quick patch to fix those errors while running updates.

  • ๐Ÿ‡ฆ๐Ÿ‡นAustria maxilein

    Thank you Julien. That patch made the errors go away when upgrading.

    More information on the Drupal CMS upgrade for vinodhini.e:

    composer update
    Loading composer repositories with package information
    Updating dependencies
    Lock file operations: 0 installs, 11 updates, 0 removals
      - Upgrading drupal/core (11.2.2 => 11.2.3)
      - Upgrading drupal/core-composer-scaffold (11.2.2 => 11.2.3)
      - Upgrading drupal/core-project-message (11.2.2 => 11.2.3)
      - Upgrading drupal/core-recommended (11.2.2 => 11.2.3)
      - Upgrading drupal/geofield (1.64.0 => 1.65.0)
      - Upgrading drupal/linkit (7.0.7 => 7.0.8)
      - Upgrading drupal/project_browser (2.1.0-beta2 => 2.1.0-beta3)
      - Upgrading drupal/solo (dev-1.0.x babe75b => dev-1.0.x 4b6e29e)
      - Upgrading drush/drush (13.6.1 => 13.6.2)
      - Upgrading nette/utils (v4.0.7 => v4.0.8)
      - Upgrading sebastian/diff (6.0.2 => 7.0.0)
    Writing lock file
    Installing dependencies from lock file (including require-dev)
    Package operations: 0 installs, 11 updates, 0 removals
      - Downloading sebastian/diff (7.0.0)
      - Downloading drupal/core (11.2.3)
      - Downloading drupal/linkit (7.0.8)
      - Downloading nette/utils (v4.0.8)
      - Downloading drupal/geofield (1.65.0)
      - Downloading drupal/project_browser (2.1.0-beta3)
      - Downloading drush/drush (13.6.2)
      - Syncing drupal/solo (dev-1.0.x 4b6e29e) into cache
      - Upgrading drupal/core-composer-scaffold (11.2.2 => 11.2.3): Extracting archive
      - Upgrading drupal/core-project-message (11.2.2 => 11.2.3): Extracting archive
      - Upgrading sebastian/diff (6.0.2 => 7.0.0): Extracting archive
      - Upgrading drupal/core (11.2.2 => 11.2.3): Extracting archive
      - Upgrading drupal/core-recommended (11.2.2 => 11.2.3)
      - Upgrading drupal/linkit (7.0.7 => 7.0.8): Extracting archive
      - Upgrading nette/utils (v4.0.7 => v4.0.8): Extracting archive
      - Upgrading drupal/geofield (1.64.0 => 1.65.0): Extracting archive
      - Upgrading drupal/project_browser (2.1.0-beta2 => 2.1.0-beta3): Extracting archive
      - Upgrading drush/drush (13.6.1 => 13.6.2): Extracting archive
      - Upgrading drupal/solo (dev-1.0.x babe75b => dev-1.0.x 4b6e29e): Checking out 4b6e29ea92 from cache
    Generating optimized autoload files
    54 packages you are using are looking for funding.
    Use the `composer fund` command to find out more!
    No security vulnerability advisories found.
    
    

    And the final working result with the patch included:

    drush updb
     [warning] Drupal requires databases that support JSON storage.
     (Currently using Database support for JSON Available
    )
     [warning] Package Manager is available for early testing. To install the module set the
    value of 'testing_package_manager' to TRUE in your settings.php file.
    
    
     โ”Œ Requirements check reports errors. Do you wish to continue? โ”€โ”
     โ”‚ Yes                                                          โ”‚
     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
    
     ----------------- --------------- ------------- ----------------------------
      Module            Update ID       Type          Description
     ----------------- --------------- ------------- ----------------------------
      project_browser   convert_enabl   post-update   Updates Project Browser
                        ed_sources_to                 settings to support
                        _arrays                       source-specific
                                                      configuration.
      project_browser   rebuild_conta   post-update   Clears the cache so that
                        iner_for_oo_h                 Project Browser's OO hooks
                        ooks                          are registered.
     ----------------- --------------- ------------- ----------------------------
    
    
     โ”Œ Do you wish to run the specified pending updates? โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
     โ”‚ Yes                                                          โ”‚
     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
    
    >  [notice] Update started: project_browser_post_update_convert_enabled_sources_to_arrays
    >  [notice] Update completed: project_browser_post_update_convert_enabled_sources_to_arrays
    >  [notice] Update started: project_browser_post_update_rebuild_container_for_oo_hooks
    >  [notice] Update completed: project_browser_post_update_rebuild_container_for_oo_hooks
     [success] Finished performing updates.
    
    
    
Production build 0.71.5 2024