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

Command icon 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

KarimBou created an issue. See original summary.

neslee canil pinto’s picture

Version: 8.x-1.15 » 8.x-1.x-dev

@KarimBou i am not able to reproduce this error here, can you please provide more details on this.

greg boggs’s picture

Status: Active » Postponed (maintainer needs more info)
joebot’s picture

I 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.

greg boggs’s picture

We 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!

greg boggs’s picture

Status: Postponed (maintainer needs more info) » Active
xmacinfo’s picture

I 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.

othmen’s picture

Exactly like @xmacinfo! I have the problem when executing drush cim or drush updb and resolved after uninstall Easy Breadcrumb.

peter törnstrand’s picture

The 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:

-capitalizator_ignored_words: ''
-capitalizator_forced_words: ''
+capitalizator_ignored_words: {  }
+capitalizator_forced_words: {  }
tim_dj’s picture

If you're stuck during an upgrade you can also do:

drush cset easy_breadcrumb.settings capitalizator_ignored_words {} --input-format=yaml
drush cset easy_breadcrumb.settings capitalizator_forced_words {} --input-format=yaml
greg boggs’s picture

Version: 8.x-1.x-dev » 2.x-dev
Priority: Major » Normal
jwinning’s picture

Issue tags: -
StatusFileSize
new1 KB

Here'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!

greg boggs’s picture

looks good. Can we get this as a merge request and also change array() to [] because array() is the php 5.3 syntax :)

greg boggs’s picture

Status: Active » Needs work

Binoli Lalani made their first commit to this issue’s fork.

binoli lalani’s picture

Status: Needs work » Needs review

Hello,

I have created MR and changed array() to [].

Please review.

Thank you!

greg boggs’s picture

Status: Needs review » Fixed

Thanks for all the great work folks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

dunot’s picture

This can happen when you update Drupal core with the module.
So just run /update.php