TypeError: strtr(): Argument #1 ($string) must be of type string

Created on 8 January 2024, 10 months ago
Updated 7 February 2024, 9 months ago

Hi, I get this error message when installing . drupal 10.2 and php8.1

TypeError: strtr(): Argument #1 ($string) must be of type string, Drupal\Core\StringTranslation\TranslatableMarkup given in /home/tesjanebiir22/public_html/vendor/drush/drush/src/Log/DrushLog.php on line 78 #0 /home/tesjanebiir22/public_html/vendor/drush/drush/src/Log/DrushLog.php(78): strtr()
#1 /home/tesjanebiir22/public_html/core/lib/Drupal/Core/Logger/LoggerChannel.php(127): Drush\Log\DrushLog->log()
#2 /home/tesjanebiir22/public_html/vendor/psr/log/src/LoggerTrait.php(114): Drupal\Core\Logger\LoggerChannel->log()
#3 /home/tesjanebiir22/public_html/modules/contrib/dbee/dbee.users.inc(165): Drupal\Core\Logger\LoggerChannel->info()
#4 /home/tesjanebiir22/public_html/modules/contrib/dbee/dbee.users.inc(52): dbee_update_crypt_users_all_batch_finished()
#5 /home/tesjanebiir22/public_html/modules/contrib/dbee/dbee.install(83): dbee_update_crypt_all()
#6 [internal function]: dbee_uninstall()
#7 /home/tesjanebiir22/public_html/core/lib/Drupal/Core/Extension/ModuleHandler.php(400): call_user_func_array()
#8 /home/tesjanebiir22/public_html/core/lib/Drupal/Core/Extension/ModuleInstaller.php(474): Drupal\Core\Extension\ModuleHandler->invoke()
#9 /home/tesjanebiir22/public_html/core/lib/Drupal/Core/ProxyClass/Extension/ModuleInstaller.php(91): Drupal\Core\Extension\ModuleInstaller->uninstall()
#10 /home/tesjanebiir22/public_html/vendor/drush/drush/src/Commands/pm/PmCommands.php(194): Drupal\Core\ProxyClass\Extension\ModuleInstaller->uninstall()
#11 [internal function]: Drush\Commands\pm\PmCommands->uninstall()
#12 /home/tesjanebiir22/public_html/vendor/consolidation/annotated-command/src/CommandProcessor.php(276): call_user_func_array()
#13 /home/tesjanebiir22/public_html/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback()
#14 /home/tesjanebiir22/public_html/vendor/consolidation/annotated-command/src/CommandProcessor.php(176): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter()
#15 /home/tesjanebiir22/public_html/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(391): Consolidation\AnnotatedCommand\CommandProcessor->process()
#16 /home/tesjanebiir22/public_html/vendor/symfony/console/Command/Command.php(326): Consolidation\AnnotatedCommand\AnnotatedCommand->execute()
#17 /home/tesjanebiir22/public_html/vendor/symfony/console/Application.php(1096): Symfony\Component\Console\Command\Command->run()
#18 /home/tesjanebiir22/public_html/vendor/symfony/console/Application.php(324): Symfony\Component\Console\Application->doRunCommand()
#19 /home/tesjanebiir22/public_html/vendor/symfony/console/Application.php(175): Symfony\Component\Console\Application->doRun()
#20 /home/tesjanebiir22/public_html/vendor/drush/drush/src/Runtime/Runtime.php(110): Symfony\Component\Console\Application->run()
#21 /home/tesjanebiir22/public_html/vendor/drush/drush/src/Runtime/Runtime.php(40): Drush\Runtime\Runtime->doRun()
#22 /home/tesjanebiir22/public_html/vendor/drush/drush/drush.php(139): Drush\Runtime\Runtime->run()
#23 /home/tesjanebiir22/public_html/vendor/drush/drush/drush(4): require('...')
#24 /home/tesjanebiir22/public_html/vendor/bin/drush(119): include('...')
#25 {main}

🐛 Bug report
Status

Fixed

Version

3.0

Component

Code

Created by

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

Comments & Activities

  • Issue created by @bolaghi
  • Issue was unassigned.
  • 🇮🇳India dineshkumarbollu

    Hi bolaghi

    I am unable to reproduce the issue, The module install without any error in my system.
    Drupal : 10.2
    PHP : 8.1

  • 1 am use virtualmin webpanel . server ubnutu22.04 and install multiple php , php8.2 and php8.1 . but my php set to php8.1 .

  • 🇦🇺Australia elc

    The stack trace you have provided is from un-installing the module:

    #9 /home/tesjanebiir22/public_html/core/lib/Drupal/Core/ProxyClass/Extension/ModuleInstaller.php(91): Drupal\Core\Extension\ModuleInstaller->uninstall()

    And it's while attempting to write a drush log write out. Are you using the latest version of drush? And did you fully install the module before uninstalling it?

  • Status changed to Needs work 10 months ago
  • 🇵🇹Portugal jcnventura

    There's indeed a problem in that code, as there's two subsequent calls, first to the logger that doesn't accept translated strings, and then to the messenger that does take a translated string.. There's also a lot of complicated code wrangling to be able to call them in a single place that honestly does nothing to make this code easier to understand..

    I'm committing something that is not pretty as it simply dumps the current action to the logger, but at least should get rid of this error and make the code easier to read.

    • jcnventura authored 3df1647f on 3.x
      Issue #3413321 by jcnventura: Argument to logger must be of type string
      
  • Status changed to Fixed 10 months ago
  • Automatically closed - issue fixed for 2 weeks with no activity.

  • hi.new update solve my problem.
    dev-3.x 350846d
    thank for all.

Production build 0.71.5 2024