Commit a943f581 authored by catch's avatar catch

Issue #2380607 by Berdir, dawehner: Do not call ConfigBase::validateKeys() for...

Issue #2380607 by Berdir, dawehner: Do not call ConfigBase::validateKeys() for data loaded from storage
parent fa31ac08
......@@ -80,7 +80,6 @@ public function initWithData(array $data) {
parent::initWithData($data);
$this->settingsOverrides = array();
$this->moduleOverrides = array();
$this->setData($data);
return $this;
}
......@@ -109,8 +108,8 @@ public function get($key = '') {
/**
* {@inheritdoc}
*/
public function setData(array $data) {
parent::setData($data);
public function setData(array $data, $validate_keys = TRUE) {
parent::setData($data, $validate_keys);
$this->resetOverriddenData();
return $this;
}
......
......@@ -157,6 +157,10 @@ public function get($key = '') {
*
* @param array $data
* The new configuration data.
* @param bool $validate_keys
* (optional) Whether the data should be verified for valid keys. Set to
* FALSE if the $data is known to be valid already (for example, being
* loaded from the config storage).
*
* @return $this
* The configuration object.
......@@ -164,8 +168,10 @@ public function get($key = '') {
* @throws \Drupal\Core\Config\ConfigValueException
* If any key in $data in any depth contains a dot.
*/
public function setData(array $data) {
$this->validateKeys($data);
public function setData(array $data, $validate_keys = TRUE) {
if ($validate_keys) {
$this->validateKeys($data);
}
$this->data = $data;
return $this;
}
......
......@@ -90,7 +90,7 @@ abstract class StorableConfigBase extends ConfigBase {
*/
public function initWithData(array $data) {
$this->isNew = FALSE;
$this->setData($data);
$this->setData($data, FALSE);
$this->originalData = $this->data;
return $this;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment