Commit e25a1ec7 authored by catch's avatar catch

Issue #2295737 by Gábor Hojtsy, vijaycs85, alexpott: Fixed Not all shipped...

Issue #2295737 by Gábor Hojtsy, vijaycs85, alexpott: Fixed Not all shipped configuration passes validation even with all modules enabled.
parent 179c0920
......@@ -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'
......@@ -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.');
}
......
......@@ -18,6 +18,8 @@
*/
class ConfigImportAllTest extends ModuleTestBase {
use SchemaCheckTestTrait;
/**
* The profile to install as a basis for testing.
*
......@@ -118,5 +120,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());
}
}
}
......@@ -2,7 +2,7 @@
field.entity_reference.settings:
type: mapping
label: 'Settings'
label: 'Entity reference settings'
mapping:
target_type:
type: string
......
......@@ -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'
......
......@@ -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();
}
......
......@@ -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'
......
......@@ -24,3 +24,6 @@ menu.entity.node.*:
sequence:
- type: string
label: 'Menu machine name'
parent:
type: string
label: 'Parent'
id: d6_comment_entity_form_display_subject
label: Drupal 6 comment subject form display configuration
migration_groups:
- Drupal 6
source:
plugin: d6_comment_variable_per_comment_type
constants:
......
# 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
......@@ -10,9 +10,3 @@ shortcut.set.*:
label:
type: label
label: 'Label'
links:
type: sequence
label: 'Shortcuts'
sequence:
- type: string
label: 'Shortcut'
......@@ -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
......
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