Unable to remove entry in a key/value config array

Created on 21 November 2016, almost 8 years ago
Updated 22 August 2023, about 1 year ago

Using config overrides mecanism, it is not possible de unset an entry.
Using this example (language.negatiation.yml) it will be clearer :

With a such config, it is not possible to unset the "url.prefixes.es" entry.
I agree it's not a common situation, but that's an example.
Any "alter" mecanism is available, all we can do it's to "add" and "update" a leaf.

This restriction is due to "NestedArray::mergeDeepArray" function called in the "ConfigFactory::loadOverrides" and in the "Config::setOverriddenData" and "Config::getOriginal" functions which simply merge values.

The solution would be:
- to implement a "loadOverridesAlter" in the "ConfigFactoryOverrideInterface" interface
- to implement an additionnal alter function in the "ConfigFactoryOverrideInterface" which could manipulated the merging config at each step.

session:
  parameter: language
url:
  source: path_prefix
  prefixes:
    en: ''
    fr: fr
    it: it
    es: es
  domains:
    en: ''
    fr: ''
    it: ''
    es: ''
selected_langcode: site_default
✨ Feature request
Status

Active

Version

11.0 πŸ”₯

Component
ConfigurationΒ  β†’

Last updated 1 day ago

Created by

πŸ‡«πŸ‡·France Sebastien M.

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024