diff --git a/core/lib/Drupal/Core/Config/Schema/SchemaDiscovery.php b/core/lib/Drupal/Core/Config/Schema/SchemaDiscovery.php index 41b88ca..fad8b98 100644 --- a/core/lib/Drupal/Core/Config/Schema/SchemaDiscovery.php +++ b/core/lib/Drupal/Core/Config/Schema/SchemaDiscovery.php @@ -48,7 +48,7 @@ public function getDefinition($base_plugin_id) { if (isset($this->definitions[$base_plugin_id])) { $type = $base_plugin_id; } - elseif (strpos($base_plugin_id, '.') && ($name = $this->getFallbackName($base_plugin_id)) && isset($this->definitions[$name])) { + elseif (strpos($base_plugin_id, '.') && $name = $this->getFallbackName($base_plugin_id)) { // Found a generic name, replacing the last element by '*'. $type = $name; } @@ -58,6 +58,7 @@ public function getDefinition($base_plugin_id) { $type = 'default'; } $definition = $this->definitions[$type]; + // Check whether this type is an extension of another one and compile it. if (isset($definition['type'])) { $merge = $this->getDefinition($definition['type']); @@ -98,10 +99,15 @@ protected function loadAllSchema() { * @return string * Same name with the last part replaced by the filesystem marker. */ - protected static function getFallbackName($name) { - $replaced = preg_replace('/\.[^.]+$/', '.' . '*', $name); - if ($replaced != $name) { - return $replaced; + protected function getFallbackName($name) { + $replaced = preg_replace('/(\.[^\.]+)([\.\*]*)$/', '.*\2', $name); + if ($replaced != $name ) { + if (isset($this->definitions[$replaced])) { + return $replaced; + } + else { + return self::getFallbackName($replaced); + } } } }