Change record status: 
Project: 
Introduced in branch: 
8.x
Introduced in version: 
8.0
Description: 

Configuration uses dots as a separator. However Config::set() and Config::setData() were not consistent in how they apply dots. For example the following two did the same thing:

// These do the same thing.
$config->set('foo', array('bar' => 12);
$config->set('foo.bar', 12);

$config->get('foo');
// Will be array('bar' => 12) for both.

The following two resulted in totally different things.

// These were totally different.
$config->set('foo', array('bar.baz' => 12);
$config->set('foo.bar.baz', 12);

$config->get('foo');
// Was array('bar.baz' => 12) for the first but array('bar' => array('baz' => 12)) for the second.

This causes problems because several systems assume the dotted referencing works for any part of configuration. Where 'bar.baz' is the key of something on a level, it is not possible to refer to it with the dotted syntax, because it resolves to a different level in the configuration.

To avoid such confusing situations, dotted keys are now disallowed on all levels of configuration. If you attempt to call set() or setData() with a data array containing dots on any level, you'll get a ConfigValueException instead. So the new behaviour:

// This will throw a ConfigValueException. Not possible anymore in any way to use a dot in a data key.
$config->set('foo', array('bar.baz' => 12);
// This will work and still produce array('foo' => array('bar' => array('baz' => 12))) as before. 
$config->set('foo.bar.baz', 12);
Impacts: 
Module developers