From d80ef3d9e6fc211669b6b93bec9c166d23bb1c74 Mon Sep 17 00:00:00 2001 From: Daniel Hensby Date: Thu, 12 Jul 2018 01:09:17 +0100 Subject: [PATCH] DOCS Update docs to reflect true config merge priorities --- .../04_Configuration/00_Configuration.md | 4 ++-- docs/en/04_Changelogs/4.0.5.md | 12 ++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 docs/en/04_Changelogs/4.0.5.md diff --git a/docs/en/02_Developer_Guides/04_Configuration/00_Configuration.md b/docs/en/02_Developer_Guides/04_Configuration/00_Configuration.md index e0ad2520b..7eac928d9 100644 --- a/docs/en/02_Developer_Guides/04_Configuration/00_Configuration.md +++ b/docs/en/02_Developer_Guides/04_Configuration/00_Configuration.md @@ -153,12 +153,12 @@ the result will be the higher priority false-ish value. The locations that configuration values are taken from in highest -> lowest priority order are: -- Any values set via a call to Config#merge / Config#set +- Runtime modifications, ie: any values set via a call to `Config::inst()->update()` - The configuration values taken from the YAML files in `_config/` directories (internally sorted in before / after order, where the item that is latest is highest priority) -- Any static set on an "additional static source" class (such as an extension) named the same as the name of the property - Any static set on the class named the same as the name of the property - The composite configuration value of the parent class of this class +- Any static set on an "additional static source" class (such as an extension) named the same as the name of the property
It is an error to have mixed types of the same named property in different locations. An error will not necessarily diff --git a/docs/en/04_Changelogs/4.0.5.md b/docs/en/04_Changelogs/4.0.5.md new file mode 100644 index 000000000..0fc65d7f7 --- /dev/null +++ b/docs/en/04_Changelogs/4.0.5.md @@ -0,0 +1,12 @@ +# 4.0.5 + +## Notable changes + +Fix [#7971](https://github.com/silverstripe/silverstripe-framework/pull/7971) introduces a subtle change of behaviour +to how `Config` settings are prioritised. In SilverStripe 4 there was a change where `Extension` objects took the +highest importance when determining Config values; this was deemed to be unexpected and unintuitive as well as making it +cumbersome and difficult for developers to override module defaults defined in `Extension`s. This change reverts +behaviour to that of SilverStripe 3 where `Extension` instances are of lowest importance and are used only to set a +default value. If you rely on your `Extension` or module providing an overriding config value, please move this to yaml. + +