diff --git a/core/lib/Drupal/Core/Config/Schema/Undefined.php b/core/lib/Drupal/Core/Config/Schema/Undefined.php index 1bcf744..5aa2845 100644 --- a/core/lib/Drupal/Core/Config/Schema/Undefined.php +++ b/core/lib/Drupal/Core/Config/Schema/Undefined.php @@ -6,6 +6,8 @@ */ namespace Drupal\Core\Config\Schema; +use Drupal\Component\Utility\String; +use Drupal\Core\Config\ConfigException; /** * Undefined configuration element. @@ -13,6 +15,15 @@ class Undefined extends Element { /** + * {@inheritdoc} + */ + protected function parseElement($key, $data, $definition) { + // Throw exceptions for undefined elements for testing. + throw new ConfigException(String::format("The configuration property @key.@element doesn't exist.", array('@key' => $this->getFullName(), '@element' => $key))); + return \Drupal::service('config.typed')->create($definition, $data, $key, $this); + } + + /** * {@inheritdoc}. */ public function validate() { diff --git a/core/lib/Drupal/Core/Config/TypedConfigManager.php b/core/lib/Drupal/Core/Config/TypedConfigManager.php index ba3f353..19811d3 100644 --- a/core/lib/Drupal/Core/Config/TypedConfigManager.php +++ b/core/lib/Drupal/Core/Config/TypedConfigManager.php @@ -80,7 +80,7 @@ public function get($name) { $data = $this->configStorage->read($name); $type_definition = $this->getDefinition($name); $data_definition = $this->buildDataDefinition($type_definition, $data); - return $this->create($data_definition, $data); + return $this->create($data_definition, $data, $name); } /**