Do not require the config in #config_target to be listed in getEditableConfigNames()

Created on 3 November 2023, about 1 year ago
Updated 8 November 2023, about 1 year ago

Problem/Motivation

We've added the ability to link a config object to a form element using #config_target in πŸ“Œ Introduce a new #config_target Form API property to make it super simple to use validation constraints on simple config forms, and adopt it in several core config forms Fixed . We still require the config to be in \Drupal\Core\Form\ConfigFormBaseTrait::getEditableConfigNames() but this is no longer necessary. The reason this existed was to ensure the $this->config() returns non-overridden config to ensure that overrides in settings.php to not get saved to config. We can get the non-overriden config in \Drupal\Core\Form\ConfigFormBase::loadDefaultValuesFromConfig().

The advantages of this is that:

  • You don't have to repeat yourself in - of course #config_target should get non-overridden config and \Drupal\Core\Form\ConfigFormBase::copyFormValuesToConfig() should use editable config
  • Form alters like dblog_form_system_logging_settings_alter() will not need an extra submit

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

πŸ“Œ Task
Status

Fixed

Version

10.2 ✨

Component
ConfigurationΒ  β†’

Last updated 3 days 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