diff --git a/core/config/schema/core.data_types.schema.yml b/core/config/schema/core.data_types.schema.yml index 0c92bdc..fb9aad1 100644 --- a/core/config/schema/core.data_types.schema.yml +++ b/core/config/schema/core.data_types.schema.yml @@ -329,3 +329,13 @@ display_variant.plugin: uuid: type: string label: 'UUID' + +base_entity_reference_field_settings: + type: mapping + mapping: + target_type: + type: string + label: 'Type of item to reference' + target_bundle: + type: string + label: 'Bundle of item to reference' diff --git a/core/lib/Drupal/Core/Config/Schema/SchemaCheckTrait.php b/core/lib/Drupal/Core/Config/Schema/SchemaCheckTrait.php index 0836eaf..536a4cb 100644 --- a/core/lib/Drupal/Core/Config/Schema/SchemaCheckTrait.php +++ b/core/lib/Drupal/Core/Config/Schema/SchemaCheckTrait.php @@ -80,6 +80,11 @@ protected function checkValue($key, $value) { $error_key = $this->configName . ':' . $key; $element = $this->schema->get($key); if ($element instanceof Undefined) { + // @todo Temporary workaround for https://www.drupal.org/node/2224761. + $key_parts = explode('.', $key); + if (array_pop($key_parts) == 'translation_sync' && strpos($this->configName, 'field.') === 0) { + return array(); + } return array($error_key => 'Missing schema.'); } diff --git a/core/modules/config/src/Tests/ConfigImportAllTest.php b/core/modules/config/src/Tests/ConfigImportAllTest.php index 83100f3..07c9567 100644 --- a/core/modules/config/src/Tests/ConfigImportAllTest.php +++ b/core/modules/config/src/Tests/ConfigImportAllTest.php @@ -15,6 +15,8 @@ */ class ConfigImportAllTest extends ModuleTestBase { + use SchemaCheckTestTrait; + /** * The profile to install as a basis for testing. * @@ -123,5 +125,17 @@ public function testInstallUninstall() { $this->container->get('config.manager') ); $this->assertIdentical($storage_comparer->createChangelist()->getChangelist(), $storage_comparer->getEmptyChangelist()); + + // Now we have all configuration imported, test all of them for schema + // conformance. Ensures all imported default configuration is valid when + // all modules are enabled. + $names = $this->container->get('config.storage')->listAll(); + $factory = $this->container->get('config.factory'); + /** @var \Drupal\Core\Config\TypedConfigManagerInterface $typed_config */ + $typed_config = $this->container->get('config.typed'); + foreach ($names as $name) { + $config = $factory->get($name); + $this->assertConfigSchema($typed_config, $name, $config->get()); + } } } diff --git a/core/modules/entity_reference/config/schema/entity_reference.schema.yml b/core/modules/entity_reference/config/schema/entity_reference.schema.yml index 423dbc3..242faf3 100644 --- a/core/modules/entity_reference/config/schema/entity_reference.schema.yml +++ b/core/modules/entity_reference/config/schema/entity_reference.schema.yml @@ -2,7 +2,7 @@ field.entity_reference.settings: type: mapping - label: 'Settings' + label: 'Entity reference settings' mapping: target_type: type: string diff --git a/core/modules/file/config/schema/file.schema.yml b/core/modules/file/config/schema/file.schema.yml index 0fb20de..08634dd 100644 --- a/core/modules/file/config/schema/file.schema.yml +++ b/core/modules/file/config/schema/file.schema.yml @@ -23,7 +23,7 @@ file.settings: label: 'Directory' field.file.settings: - type: mapping + type: base_entity_reference_field_settings label: 'File settings' mapping: display_field: @@ -43,10 +43,12 @@ field.file.value: - type: string label: 'Value' -field.file.instance_settings: +base_file_field_instance_settings: type: mapping - label: 'File settings' mapping: + handler: + type: string + label: 'Reference method' file_directory: type: string label: 'File directory' @@ -56,6 +58,11 @@ field.file.instance_settings: max_filesize: type: string label: 'Maximum upload size' + +field.file.instance_settings: + type: base_file_field_instance_settings + label: 'File settings' + mapping: description_field: type: boolean label: 'Enable Description field' diff --git a/core/modules/file/src/Plugin/Field/FieldType/FileItem.php b/core/modules/file/src/Plugin/Field/FieldType/FileItem.php index 6af6741..a56448a 100644 --- a/core/modules/file/src/Plugin/Field/FieldType/FileItem.php +++ b/core/modules/file/src/Plugin/Field/FieldType/FileItem.php @@ -32,8 +32,8 @@ class FileItem extends EntityReferenceItem { public static function defaultSettings() { return array( 'target_type' => 'file', - 'display_field' => 0, - 'display_default' => 0, + 'display_field' => FALSE, + 'display_default' => FALSE, 'uri_scheme' => file_default_scheme(), ) + parent::defaultSettings(); } diff --git a/core/modules/image/config/schema/image.schema.yml b/core/modules/image/config/schema/image.schema.yml index 2985696..4f1fc79 100644 --- a/core/modules/image/config/schema/image.schema.yml +++ b/core/modules/image/config/schema/image.schema.yml @@ -73,29 +73,17 @@ image.settings: label: 'Suppress the itok query string for image derivatives' field.image.settings: - type: mapping + type: field.file.settings label: 'Image settings' mapping: - uri_scheme: - type: string - label: 'Upload destination' default_image: type: field_default_image label: 'Default value' field.image.instance_settings: - type: mapping + type: base_file_field_instance_settings label: 'Image settings' mapping: - file_directory: - type: string - label: 'Upload destination' - file_extensions: - type: string - label: 'Allowed file extensions' - max_filesize: - type: string - label: 'Maximum upload size' max_resolution: type: string label: 'Maximum image resolution' diff --git a/core/modules/menu_ui/config/schema/menu_ui.schema.yml b/core/modules/menu_ui/config/schema/menu_ui.schema.yml index ce6be8b..7625f0d 100644 --- a/core/modules/menu_ui/config/schema/menu_ui.schema.yml +++ b/core/modules/menu_ui/config/schema/menu_ui.schema.yml @@ -24,3 +24,6 @@ menu.entity.node.*: sequence: - type: string label: 'Menu machine name' + parent: + type: string + label: 'Parent' diff --git a/core/modules/path/config/schema/path.schema.yml b/core/modules/path/config/schema/path.schema.yml new file mode 100644 index 0000000..f595e4b --- /dev/null +++ b/core/modules/path/config/schema/path.schema.yml @@ -0,0 +1,8 @@ +# Schema for the configuration files of the Path module. + +entity_form_display.field.path: + type: entity_field_form_display_base + label: 'Link format settings' + mapping: + settings: + type: sequence diff --git a/core/modules/shortcut/config/schema/shortcut.schema.yml b/core/modules/shortcut/config/schema/shortcut.schema.yml index daef434..9332699 100644 --- a/core/modules/shortcut/config/schema/shortcut.schema.yml +++ b/core/modules/shortcut/config/schema/shortcut.schema.yml @@ -10,9 +10,3 @@ shortcut.set.*: label: type: label label: 'Label' - links: - type: sequence - label: 'Shortcuts' - sequence: - - type: string - label: 'Shortcut' diff --git a/core/modules/taxonomy/config/schema/taxonomy.schema.yml b/core/modules/taxonomy/config/schema/taxonomy.schema.yml index c3d0bd4..40004c3 100644 --- a/core/modules/taxonomy/config/schema/taxonomy.schema.yml +++ b/core/modules/taxonomy/config/schema/taxonomy.schema.yml @@ -35,7 +35,7 @@ taxonomy.vocabulary.*: label: 'Weight' field.taxonomy_term_reference.settings: - type: mapping + type: base_entity_reference_field_settings label: 'Taxonomy term reference settings' mapping: options_list_callback: @@ -56,11 +56,12 @@ field.taxonomy_term_reference.settings: value: 'Parent' field.taxonomy_term_reference.instance_settings: - type: sequence + type: mapping label: 'Taxonomy term reference settings' - sequence: - - type: string - label: 'Setting' + mapping: + handler: + type: string + label: 'Reference method' field.taxonomy_term_reference.value: type: sequence