From a542a43cbc60f6c4d49b723e7a6da48c69d349b0 Mon Sep 17 00:00:00 2001 From: Alex Pott <alex.a.pott@googlemail.com> Date: Wed, 7 Jan 2015 23:51:12 +0000 Subject: [PATCH] =?UTF-8?q?Issue=20#2392263=20by=20G=C3=A1bor=20Hojtsy:=20?= =?UTF-8?q?Sequence=20subtyping=20cannot=20override=20item=20type=20in=20c?= =?UTF-8?q?onfig=20schema,=20views=20taxonomy=20term=20filter=20schema=20i?= =?UTF-8?q?ncorrect?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Drupal/Core/Config/TypedConfigManager.php | 4 +++- .../config/schema/taxonomy.views.schema.yml | 24 +++++-------------- ...ws.view.test_filter_taxonomy_index_tid.yml | 2 +- .../config/schema/views.filter.schema.yml | 13 ---------- 4 files changed, 10 insertions(+), 33 deletions(-) diff --git a/core/lib/Drupal/Core/Config/TypedConfigManager.php b/core/lib/Drupal/Core/Config/TypedConfigManager.php index d775cc2d30ea..fb1c19808eb6 100644 --- a/core/lib/Drupal/Core/Config/TypedConfigManager.php +++ b/core/lib/Drupal/Core/Config/TypedConfigManager.php @@ -130,7 +130,9 @@ public function getDefinition($base_plugin_id, $exception_on_invalid = TRUE) { // Check whether this type is an extension of another one and compile it. if (isset($definition['type'])) { $merge = $this->getDefinition($definition['type'], $exception_on_invalid); - $definition = NestedArray::mergeDeep($merge, $definition); + // Preserve integer keys on merge, so sequence item types can override + // parent settings as opposed to adding unused second, third, etc. items. + $definition = NestedArray::mergeDeepArray(array($merge, $definition), TRUE); // Unset type so we try the merge only once per type. unset($definition['type']); $this->definitions[$type] = $definition; diff --git a/core/modules/taxonomy/config/schema/taxonomy.views.schema.yml b/core/modules/taxonomy/config/schema/taxonomy.views.schema.yml index 3b46f3da77ec..d64639ec739b 100644 --- a/core/modules/taxonomy/config/schema/taxonomy.views.schema.yml +++ b/core/modules/taxonomy/config/schema/taxonomy.views.schema.yml @@ -148,29 +148,17 @@ views.filter.taxonomy_index_tid: error_message: type: boolean label: 'Display error message' - -views.filter.taxonomy_index_tid_depth: - type: views.filter.in_operator - label: 'Taxonomy term ID with depth' - mapping: - operator: - type: string - label: 'Operator' value: type: sequence label: 'Values' sequence: - - type: string + - type: integer label: 'Value' - vid: - type: string - label: 'Vocabulary' - type: - type: string - label: 'Selection type' - hierarchy: - type: boolean - label: 'Show hierarchy in dropdown' + +views.filter.taxonomy_index_tid_depth: + type: views.filter.taxonomy_index_tid + label: 'Taxonomy term ID with depth' + mapping: depth: type: integer label: 'Depth' diff --git a/core/modules/taxonomy/tests/modules/taxonomy_test_views/test_views/views.view.test_filter_taxonomy_index_tid.yml b/core/modules/taxonomy/tests/modules/taxonomy_test_views/test_views/views.view.test_filter_taxonomy_index_tid.yml index 430f6f983f54..c8b3192fb55c 100644 --- a/core/modules/taxonomy/tests/modules/taxonomy_test_views/test_views/views.view.test_filter_taxonomy_index_tid.yml +++ b/core/modules/taxonomy/tests/modules/taxonomy_test_views/test_views/views.view.test_filter_taxonomy_index_tid.yml @@ -136,7 +136,7 @@ display: admin_label: '' operator: or value: - - '2' + - 2 group: 1 exposed: false expose: diff --git a/core/modules/views/config/schema/views.filter.schema.yml b/core/modules/views/config/schema/views.filter.schema.yml index 3a97c25b301b..969d212f371c 100644 --- a/core/modules/views/config/schema/views.filter.schema.yml +++ b/core/modules/views/config/schema/views.filter.schema.yml @@ -101,18 +101,9 @@ views.filter.many_to_one: type: views.filter.in_operator label: 'Many to one' mapping: - operator: - type: string - label: 'Operator' reduce_duplicates: type: boolean label: 'Reduce duplicate' - value: - type: sequence - label: 'Values' - sequence: - - type: string - label: 'Value' views.filter.standard: type: views_filter @@ -140,7 +131,3 @@ views.filter_value.combine: views.filter.language: type: views.filter.in_operator label: 'Language' - -views.filter_value.language: - type: string - label: 'Language' -- GitLab