Problem/Motivation
After upgrading to version 10.2 configuration broke completely - configuration entities cannot be changed anymore (views), and database updates fail with the message:
[notice] Update started: file_post_update_add_default_filename_sanitization_configuration
> [error] TypeError: Unsupported operand types: string + array in Drupal\Core\Config\TypedConfigManager->getDefinitionWithReplacements() (line 197 of /var/www/html/web/core/lib/Drupal/Core/Config/TypedConfigManager.php) #0 /var/www/html/web/core/lib/Drupal/Core/Config/TypedConfigManager.php(113): Drupal\Core\Config\TypedConfigManager->getDefinitionWithReplacements('langcode', Array)
> #1 /var/www/html/web/core/lib/Drupal/Core/Config/Schema/ArrayElement.php(153): Drupal\Core\Config\TypedConfigManager->buildDataDefinition(Array, 'et', 'langcode', Object(Drupal\Core\Config\Schema\Mapping))
> #2 /var/www/html/web/core/lib/Drupal/Core/Config/Schema/Mapping.php(26): Drupal\Core\Config\Schema\ArrayElement->buildDataDefinition(Array, 'et', 'langcode')
> #3 /var/www/html/web/core/lib/Drupal/Core/Config/Schema/ArrayElement.php(37): Drupal\Core\Config\Schema\Mapping->getElementDefinition('langcode')
> #4 /var/www/html/web/core/lib/Drupal/Core/Config/Schema/ArrayElement.php(85): Drupal\Core\Config\Schema\ArrayElement->parse()
> #5 /var/www/html/web/core/lib/Drupal/Core/Config/Schema/ArrayElement.php(59): Drupal\Core\Config\Schema\ArrayElement->getElements()
> #6 /var/www/html/web/core/lib/Drupal/Core/Config/StorableConfigBase.php(181): Drupal\Core\Config\Schema\ArrayElement->get('_core')
> #7 /var/www/html/web/core/lib/Drupal/Core/Config/StorableConfigBase.php(216): Drupal\Core\Config\StorableConfigBase->castValue('_core', Array)
> #8 /var/www/html/web/core/lib/Drupal/Core/Config/Config.php(211): Drupal\Core\Config\StorableConfigBase->castValue(NULL, Array)
> #9 /var/www/html/web/core/modules/file/file.post_update.php(44): Drupal\Core\Config\Config->save()
> #10 /var/www/html/vendor/drush/drush/src/Commands/core/UpdateDBCommands.php(280): file_post_update_add_default_filename_sanitization_configuration(Array)
> #11 /var/www/html/vendor/drush/drush/includes/batch.inc(257): Drush\Commands\core\UpdateDBCommands::updateDoOnePostUpdate('file_post_updat...', Array)
> #12 /var/www/html/vendor/drush/drush/includes/batch.inc(204): _drush_batch_worker()
> #13 /var/www/html/vendor/drush/drush/includes/batch.inc(75): _drush_batch_command('999')
Steps to reproduce
1. Update codebase to 10.2
2. Run database updates (either through browser or drush) - file_post_update_add_default_filename_sanitization_configuration fails (my other update hooks failed the same way if they tried to modify configuration) with the error above.
3. Try to log in and edit some view - white page with same error message
I was on the 10.1.7 version. It is a multilingual site, default language is not English.
The exported configuration looks fine, langcode is there and has a value.
Setting a simple configuration that does not have langcode with "drush cset" also fails with the same error.
Reverting to 10.1 makes it work again.
I tried to find the issue, but I did not find any clues what could be wrong - it tries to load langcode definition and fails because of that. Found CR that could be related:
https://www.drupal.org/node/3373721 β