From 09377f0ba4fb2376087bdb7f5b39a22cfddfeb23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sam=20Minn=C3=A9e?= Date: Wed, 13 Mar 2013 11:22:41 +1300 Subject: [PATCH] Added upgrade note for config static immutability Config statics are now immutable for performance, this requires an upgrade change. --- docs/en/changelogs/3.1.0.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/docs/en/changelogs/3.1.0.md b/docs/en/changelogs/3.1.0.md index 811d40d82..d4b199cf6 100644 --- a/docs/en/changelogs/3.1.0.md +++ b/docs/en/changelogs/3.1.0.md @@ -30,6 +30,23 @@ ## Upgrading +### Static configuration properties are now immutable, you must use Config API. + +A common SilverStripe pattern is to use a static variable on a class to define a configuration parameter. +The configuration system added in SilverStripe 3.0 builds on this by using this static variable as a way +of defining the default value. + +In SilverStripe 3.0, it was possible to edit this value at run-time and have the change propagate into the +configuration system. This is no longer the case, for performance reasons. + +Many of the configuration variables have been change to "private" so that attempts to change them throw an +error, but if you do have a configuration static that is able to be changed, and you change it, then the +configuration system will silently ignore it. + +Please change all run-time manipulation of configuration to use `Config::inst()->update()` or +`$this->config()->update()`. For more information about how to use the config system, see the +["Configuration" topic](/topic/configuration). + ### Deny URL access if `Controller::$allowed_actions` is undefined or empty array In order to make controller access checks more consistent and easier to