diff --git a/core/modules/taxonomy/src/TermViewsData.php b/core/modules/taxonomy/src/TermViewsData.php index 03c288bd9b..6d47f3ffb6 100644 --- a/core/modules/taxonomy/src/TermViewsData.php +++ b/core/modules/taxonomy/src/TermViewsData.php @@ -229,13 +229,9 @@ public function getViewsData() { 'field' => 'parent_target_id', ]; - $data['taxonomy_term__parent']['parent']['help'] = $this->t('The parent term of the term. This can produce duplicate entries if you are using a vocabulary that allows multiple parents.'); - $data['taxonomy_term__parent']['parent']['argument']['id'] = 'taxonomy'; - $data['taxonomy_term__parent']['parent']['argument']['field'] = 'parent_target_id'; - $data['taxonomy_term__parent']['parent']['relationship']['field'] = 'parent_target_id'; - $data['taxonomy_term__parent']['parent']['relationship']['label'] = $this->t('Parent'); - $data['taxonomy_term__parent']['parent']['filter']['field'] = 'parent_target_id'; - $data['taxonomy_term__parent']['parent']['sort']['field'] = 'parent_target_id'; + $data['taxonomy_term__parent']['parent_target_id']['help'] = $this->t('The parent term of the term. This can produce duplicate entries if you are using a vocabulary that allows multiple parents.'); + $data['taxonomy_term__parent']['parent_target_id']['relationship']['label'] = $this->t('Parent'); + $data['taxonomy_term__parent']['parent_target_id']['argument']['id'] = 'taxonomy'; return $data; } diff --git a/core/modules/taxonomy/tests/modules/taxonomy_test_views/test_views/views.view.test_taxonomy_term_relationship.yml b/core/modules/taxonomy/tests/modules/taxonomy_test_views/test_views/views.view.test_taxonomy_term_relationship.yml index c7aeb164fa..664ae27cf0 100644 --- a/core/modules/taxonomy/tests/modules/taxonomy_test_views/test_views/views.view.test_taxonomy_term_relationship.yml +++ b/core/modules/taxonomy/tests/modules/taxonomy_test_views/test_views/views.view.test_taxonomy_term_relationship.yml @@ -187,7 +187,7 @@ display: parent: id: parent table: taxonomy_term__parent - field: parent + field: parent_target_id relationship: none group_type: group admin_label: Parent diff --git a/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyRelationshipTest.php b/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyRelationshipTest.php index 67834c3320..3299964909 100644 --- a/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyRelationshipTest.php +++ b/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyRelationshipTest.php @@ -72,13 +72,13 @@ public function testTaxonomyRelationships() { $this->assertEqual($views_data['table']['join']['taxonomy_term_field_data']['left_field'], 'tid'); $this->assertEqual($views_data['table']['join']['taxonomy_term_field_data']['field'], 'entity_id'); // Check the parent relationship data. - $this->assertEqual($views_data['parent']['relationship']['base'], 'taxonomy_term_field_data'); - $this->assertEqual($views_data['parent']['relationship']['field'], 'parent_target_id'); - $this->assertEqual($views_data['parent']['relationship']['label'], t('Parent')); - $this->assertEqual($views_data['parent']['relationship']['id'], 'standard'); + $this->assertEqual($views_data['parent_target_id']['relationship']['base'], 'taxonomy_term_field_data'); + $this->assertEqual($views_data['parent_target_id']['relationship']['base field'], 'tid'); + $this->assertEqual($views_data['parent_target_id']['relationship']['label'], t('Parent')); + $this->assertEqual($views_data['parent_target_id']['relationship']['id'], 'standard'); // Check the parent filter and argument data. - $this->assertEqual($views_data['parent']['filter']['id'], 'numeric'); - $this->assertEqual($views_data['parent']['argument']['id'], 'taxonomy'); + $this->assertEqual($views_data['parent_target_id']['filter']['id'], 'numeric'); + $this->assertEqual($views_data['parent_target_id']['argument']['id'], 'taxonomy'); // Check an actual test view. $view = Views::getView('test_taxonomy_term_relationship');