Config saved during import does not have correct initial values set

Created on 23 October 2023, about 1 year ago
Updated 26 October 2023, about 1 year ago

Problem/Motivation

While working on πŸ› Install profile is disabled for lots of different reasons and core doesn't allow for that Fixed a bug happened due to the fact that simple configuration (eg. system.site) is created and saved without knowing about the original configuration. This means thats events listening to the \Drupal\Core\Config\ConfigEvents::SAVE event. This means that \Drupal\Core\Config\ConfigCrudEvent::isChanged() is completely wrong during config sync. This means that if you only change the system.date:first_day config we'll always set the timezone again in \Drupal\system\TimeZoneResolver::onConfigSave(). [note: this does not matter - it is just wasteful].

The bigger problem is caused by \Drupal\language\EventSubscriber\ConfigSubscriber::onConfigSave() and system.site as this bug can result in bogus rows in language.negotiation:url.prefixes.

Steps to reproduce

Proposed resolution

  • Fix \Drupal\Core\Config\ConfigImporter::importConfig() to call ->initWithData() with the old data
  • Add test coverage

Remaining tasks

User interface changes

None

API changes

None

Data model changes

None

Release notes snippet

N/a

πŸ› Bug report
Status

Fixed

Version

10.1 ✨

Component
ConfigurationΒ  β†’

Last updated about 1 hour ago

Created by

πŸ‡¬πŸ‡§United Kingdom alexpott πŸ‡ͺπŸ‡ΊπŸŒ

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

Comments & Activities

Production build 0.71.5 2024