Problem/Motivation
Issues on locale-update, installing a new module just by enabling it. When easy_breadcrumb is uninstalled we do not have this issue. Here's the stack trace.
[error] TypeError: Argument 2 passed to Drupal\locale\LocaleConfigManager::processTranslatableData() must be of the type array, string given, called in /var/www/html/drupal/core/modules/locale/src/LocaleConfigManager.php on line 223 in Drupal\locale\LocaleConfigManager->processTranslatableData() (line 215 of /var/www/html/drupal/core/modules/locale/src/LocaleConfigManager.php) #0 /var/www/html/drupal/core/modules/locale/src/LocaleConfigManager.php(223): Drupal\locale\LocaleConfigManager->processTranslatableData('easy_breadcrumb...', '', Array, 'fr')
> #1 /var/www/html/drupal/core/modules/locale/src/LocaleConfigManager.php(580): Drupal\locale\LocaleConfigManager->processTranslatableData('easy_breadcrumb...', Array, Array, 'fr')
> #2 /var/www/html/drupal/core/modules/locale/locale.bulk.inc(621): Drupal\locale\LocaleConfigManager->updateConfigTranslations(Array, Array)
> #3 /var/www/html/vendor/drush/drush/includes/batch.inc(251): locale_config_batch_refresh_name(Array, Array, Object(DrushBatchContext))
> #4 /var/www/html/vendor/drush/drush/includes/batch.inc(196): _drush_batch_worker()
> #5 /var/www/html/vendor/drush/drush/includes/batch.inc(99): _drush_batch_command('44')
> #6 /var/www/html/vendor/drush/drush/src/Drupal/Commands/core/BatchCommands.php(22): drush_batch_command('44')
> #7 [internal function]: Drush\Drupal\Commands\core\BatchCommands->process('44', Array)
> #8 /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php(257): call_user_func_array(Array, Array)
> #9 /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback(Array, Object(Consolidation\AnnotatedCommand\CommandData))
> #10 /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php(176): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter(Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
> #11 /var/www/html/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(302): Consolidation\AnnotatedCommand\CommandProcessor->process(Object(Symfony\Component\Console\Output\ConsoleOutput), Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
> #12 /var/www/html/vendor/symfony/console/Command/Command.php(255): Consolidation\AnnotatedCommand\AnnotatedCommand->execute(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
> #13 /var/www/html/vendor/symfony/console/Application.php(1010): Symfony\Component\Console\Command\Command->run(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
> #14 /var/www/html/vendor/symfony/console/Application.php(255): Symfony\Component\Console\Application->doRunCommand(Object(Consolidation\AnnotatedCommand\AnnotatedCommand), Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
> #15 /var/www/html/vendor/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
> #16 /var/www/html/vendor/drush/drush/src/Runtime/Runtime.php(118): Symfony\Component\Console\Application->run(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
> #17 /var/www/html/vendor/drush/drush/src/Runtime/Runtime.php(49): Drush\Runtime\Runtime->doRun(Array, Object(Symfony\Component\Console\Output\ConsoleOutput))
> #18 /var/www/html/vendor/drush/drush/drush.php(72): Drush\Runtime\Runtime->run(Array)
> #19 /var/www/html/vendor/drush/drush/drush(4): require('/var/www/html/v...')
> #20 {main}.
> TypeError: Argument 2 passed to Drupal\locale\LocaleConfigManager::processTranslatableData() must be of the type array, string given, called in /var/www/html/drupal/core/modules/locale/src/LocaleConfigManager.php on line 223 in /var/www/html/drupal/core/modules/locale/src/LocaleConfigManager.php on line 215 #0 /var/www/html/drupal/core/modules/locale/src/LocaleConfigManager.php(223): Drupal\locale\LocaleConfigManager->processTranslatableData('easy_breadcrumb...', '', Array, 'fr')
> #1 /var/www/html/drupal/core/modules/locale/src/LocaleConfigManager.php(580): Drupal\locale\LocaleConfigManager->processTranslatableData('easy_breadcrumb...', Array, Array, 'fr')
> #2 /var/www/html/drupal/core/modules/locale/locale.bulk.inc(621): Drupal\locale\LocaleConfigManager->updateConfigTranslations(Array, Array)
> #3 /var/www/html/vendor/drush/drush/includes/batch.inc(251): locale_config_batch_refresh_name(Array, Array, Object(DrushBatchContext))
> #4 /var/www/html/vendor/drush/drush/includes/batch.inc(196): _drush_batch_worker()
> #5 /var/www/html/vendor/drush/drush/includes/batch.inc(99): _drush_batch_command('44')
> #6 /var/www/html/vendor/drush/drush/src/Drupal/Commands/core/BatchCommands.php(22): drush_batch_command('44')
> #7 [internal function]: Drush\Drupal\Commands\core\BatchCommands->process('44', Array)
> #8 /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php(257): call_user_func_array(Array, Array)
> #9 /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback(Array, Object(Consolidation\AnnotatedCommand\CommandData))
> #10 /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php(176): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter(Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
> #11 /var/www/html/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(302): Consolidation\AnnotatedCommand\CommandProcessor->process(Object(Symfony\Component\Console\Output\ConsoleOutput), Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
> #12 /var/www/html/vendor/symfony/console/Command/Command.php(255): Consolidation\AnnotatedCommand\AnnotatedCommand->execute(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
> #13 /var/www/html/vendor/symfony/console/Application.php(1010): Symfony\Component\Console\Command\Command->run(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
> #14 /var/www/html/vendor/symfony/console/Application.php(255): Symfony\Component\Console\Application->doRunCommand(Object(Consolidation\AnnotatedCommand\AnnotatedCommand), Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
> #15 /var/www/html/vendor/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
> #16 /var/www/html/vendor/drush/drush/src/Runtime/Runtime.php(118): Symfony\Component\Console\Application->run(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
> #17 /var/www/html/vendor/drush/drush/src/Runtime/Runtime.php(49): Drush\Runtime\Runtime->doRun(Array, Object(Symfony\Component\Console\Output\ConsoleOutput))
> #18 /var/www/html/vendor/drush/drush/drush.php(72): Drush\Runtime\Runtime->run(Array)
> #19 /var/www/html/vendor/drush/drush/drush(4): require('/var/www/html/v...')
> #20 {main}
> [warning] Drush command terminated abnormally.Steps to reproduce
Drupal 8.9.16 upgrading module or installing module makke
Proposed resolution
Triying this patch didn't change anything: https://www.drupal.org/files/issues/2021-04-19/locale-error-3204721-5.patch
I tried uninstalling, clearing cache, reinstalling, exporting configurations.
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | 3218690-reformat-string-config-as-arrays-12.patch | 1 KB | jwinning |
Issue fork easy_breadcrumb-3218690
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
neslee canil pinto@KarimBou i am not able to reproduce this error here, can you please provide more details on this.
Comment #3
greg boggsComment #4
joebotI ran into this issue as well today. What I noticed was that when LocaleConfigManager::processTranslatableData() was processing the capitalizator_ignored_words list, it was receiving the list as an empty string rather than an empty array (in my case, I should have an empty array)
To resolve the issue, I just re-saved the Easy Breadcrumb settings form, which restored the empty array in the database.
I haven't tracked down how the value was saved in the database as an empty string.
Comment #5
greg boggsWe should be able to solve this by resaving the form in an update hook. I'm not sure how to do that exactly, but if someone wants to write a merge request for it that would be lovely!
Comment #6
greg boggsComment #7
xmacinfoI get that error when installing using existing configs (exported with Drush). There might be a difference between the database schema and the exported configurations.
I confirm that disabling Easy Breadcrumb module removes the error when we install our site using exported configs.
Comment #8
othmen commentedExactly like @xmacinfo! I have the problem when executing drush cim or drush updb and resolved after uninstall Easy Breadcrumb.
Comment #9
peter törnstrand commentedThe problem is that the schema defined for the config does not match the config as of some core uppdate.
To avoid uninstalling the module just change the config:
Comment #10
tim_djIf you're stuck during an upgrade you can also do:
Comment #11
greg boggsComment #12
jwinning commentedHere's my attempt at a patch.
I'm not certain if this is the most desirable approach, but it is allowing me to avoid this error without needing to uninstall the module.
I hope this helps someone!
Comment #13
greg boggslooks good. Can we get this as a merge request and also change array() to [] because array() is the php 5.3 syntax :)
Comment #14
greg boggsComment #17
binoli lalani commentedHello,
I have created MR and changed array() to [].
Please review.
Thank you!
Comment #19
greg boggsThanks for all the great work folks!
Comment #21
dunot commentedThis can happen when you update Drupal core with the module.
So just run /update.php