diff --git a/core/lib/Drupal/Core/Config/Schema/SchemaDiscovery.php b/core/lib/Drupal/Core/Config/Schema/SchemaDiscovery.php index 9a08992..41b88ca 100644 --- a/core/lib/Drupal/Core/Config/Schema/SchemaDiscovery.php +++ b/core/lib/Drupal/Core/Config/Schema/SchemaDiscovery.php @@ -38,12 +38,7 @@ class SchemaDiscovery implements DiscoveryInterface { */ public function __construct($storage) { $this->storage = $storage; - // Load definitions for all enabled modules. - foreach (module_list() as $module) { - $this->loadSchema($module); - } - // @todo Load definitions for all enabled themes. - + $this->loadAllSchema(); } /** @@ -84,11 +79,12 @@ public function getDefinitions() { /** * Load schema for module / theme. */ - protected function loadSchema($component) { - if ($schema = $this->storage->read($component . '.schema')) { - foreach ($schema as $type => $definition) { - $this->definitions[$type] = $definition; - + protected function loadAllSchema() { + foreach ($this->storage->listAll() as $name) { + if ($schema = $this->storage->read($name)) { + foreach ($schema as $type => $definition) { + $this->definitions[$type] = $definition; + } } } } diff --git a/core/lib/Drupal/Core/Config/TypedConfigManager.php b/core/lib/Drupal/Core/Config/TypedConfigManager.php index 86a8abe..187288f 100644 --- a/core/lib/Drupal/Core/Config/TypedConfigManager.php +++ b/core/lib/Drupal/Core/Config/TypedConfigManager.php @@ -25,7 +25,9 @@ class TypedConfigManager extends TypedDataManager { /** * Creates a new typed configuration manager. * - * @param \Drupal\Core\Config\StorageInterface $storage + * @param \Drupal\Core\Config\StorageInterface $configStorage + * The storage controller object to use for reading schema data + * @param \Drupal\Core\Config\StorageInterface $schemaStorage * The storage controller object to use for reading schema data */ public function __construct(StorageInterface $configStorage, StorageInterface $schemaStorage) { diff --git a/core/modules/system/config/schema/system.schema.yml b/core/modules/system/config/schema/system.data_types.schema.yml similarity index 61% copy from core/modules/system/config/schema/system.schema.yml copy to core/modules/system/config/schema/system.data_types.schema.yml index 3514260..ac9bc78 100644 --- a/core/modules/system/config/schema/system.schema.yml +++ b/core/modules/system/config/schema/system.data_types.schema.yml @@ -61,44 +61,3 @@ mail: "body": type: text label: "Body" - -# Schema for configuration files of system module: - -system.site: - type: mapping - label: 'Site information' - mapping: - "name": - label: "Site name" - type: label - "mail": - label: "Site mail" - type: email - "slogan": - label: "Site slogan" - type: text - "page": - type: mapping - mapping: - "403": - type: path - "404": - type: path - "front": - type: path - label: "Front page path" - "admin_compact_mode": - type: boolean - "weight_select_max": - type: integer - -system.maintenance: - type: mapping - label: 'Maintenance mode' - mapping: - "enabled": - type: boolean - label: "Put site into maintenance mode" - "message": - type: text - label: "Message to display when in maintenance mode" diff --git a/core/modules/system/config/schema/system.schema.yml b/core/modules/system/config/schema/system.schema.yml index 3514260..ad6755d 100644 --- a/core/modules/system/config/schema/system.schema.yml +++ b/core/modules/system/config/schema/system.schema.yml @@ -1,69 +1,4 @@ -# Basic scalar data types from typed data. -boolean: - label: 'Boolean' - class: '\Drupal\Core\TypedData\Type\Boolean' -email: - label: 'Email' - class: '\Drupal\Core\TypedData\Type\Email' -integer: - label: 'Integer' - class: '\Drupal\Core\TypedData\Type\Integer' -string: - label: 'String' - class: '\Drupal\Core\TypedData\Type\String' -uri: - label: 'Uri' - class: '\Drupal\Core\TypedData\Type\Uri' - -# Basic data types for configuration. -undefined: - label: 'Undefined' - class: '\Drupal\Core\Config\Schema\Property' -mapping: - label: Mapping - class: '\Drupal\Core\Config\Schema\Mapping' -sequence: - label: Sequence - class: '\Drupal\Core\Config\Schema\Sequence' - -# Default mapping for unknown types or types not found. -default: - type: undefined - label: 'Unknown' - -# Simple extended data types: - -# Human readable string that must be plain text and editable with a text field. -label: - type: string - label: 'Label' - -# Internal Drupal path -path: - type: string - label: 'Path' - -# Human readable string that can contain multiple lines of text or HTML. -text: - type: string - label: 'Text' - -# Complex extended data types: - -# Mail text with subject and body parts. -mail: - type: mapping - label: "Mail" - mapping: - "subject": - type: text - label: "Subject" - "body": - type: text - label: "Body" - # Schema for configuration files of system module: - system.site: type: mapping label: 'Site information'