Export original configuration to module (excluding overridden values)

Created on 26 May 2025, 11 days ago

Problem/Motivation

Now the module exports just the current configuration values to the module's config files using this approach:

  public function writeBackConfig(Config $config, array $file_names, ?array $enforced_data = NULL) {
      ...
      $data = $config->get();

At first look it is okay, but actually - it gets the current configuration, including all applied config overrides, which is usually not what users want to store in the module config.

Steps to reproduce

For example, you have a my_module.api_settings config, where store the password as empty (for security reasons) and apply it from the env variables or in any other way.
And when you export this config to the module, config_devel reads the overridden value and store it as plaintext in the module YAML file.

Proposed resolution

Read the data using $config->getOriginal() instead of $config->get() to not save overridden values to files.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇦🇲Armenia murz Yerevan, Armenia

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024