summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Pott2016-03-30 10:22:54 (GMT)
committerAlex Pott2016-03-30 10:22:54 (GMT)
commit920edd9d6e441c0f06685086be76acb9cc833250 (patch)
tree1b34b43181175ea4b7a6b1cd86026bfa95ee162f
parenteee3500713b6333c8ef930445432e5a1c0da0e20 (diff)
Revert Issue #2658956 by Daniel_Rempe, catch, Jeff Cardwell, hctom, tstoeckler, dawehner: Taxonomy vocabulary data not available as views fields
-rw-r--r--core/modules/taxonomy/src/Entity/Vocabulary.php1
-rw-r--r--core/modules/taxonomy/src/TermViewsData.php2
-rw-r--r--core/modules/taxonomy/src/Tests/Views/TaxonomyFieldVidTest.php44
-rw-r--r--core/modules/taxonomy/src/VocabularyAccessControlHandler.php37
-rw-r--r--core/modules/taxonomy/tests/modules/taxonomy_test_views/test_views/views.view.test_taxonomy_vid_field.yml163
5 files changed, 1 insertions, 246 deletions
diff --git a/core/modules/taxonomy/src/Entity/Vocabulary.php b/core/modules/taxonomy/src/Entity/Vocabulary.php
index b2a7dfc..5d6ae1d 100644
--- a/core/modules/taxonomy/src/Entity/Vocabulary.php
+++ b/core/modules/taxonomy/src/Entity/Vocabulary.php
@@ -20,7 +20,6 @@ use Drupal\taxonomy\VocabularyInterface;
* handlers = {
* "storage" = "Drupal\taxonomy\VocabularyStorage",
* "list_builder" = "Drupal\taxonomy\VocabularyListBuilder",
- * "access" = "Drupal\taxonomy\VocabularyAccessControlHandler",
* "form" = {
* "default" = "Drupal\taxonomy\VocabularyForm",
* "reset" = "Drupal\taxonomy\Form\VocabularyResetForm",
diff --git a/core/modules/taxonomy/src/TermViewsData.php b/core/modules/taxonomy/src/TermViewsData.php
index 7108504..618b4d7 100644
--- a/core/modules/taxonomy/src/TermViewsData.php
+++ b/core/modules/taxonomy/src/TermViewsData.php
@@ -71,7 +71,7 @@ class TermViewsData extends EntityViewsData {
);
$data['taxonomy_term_field_data']['vid']['help'] = $this->t('Filter the results of "Taxonomy: Term" to a particular vocabulary.');
- $data['taxonomy_term_field_data']['vid']['field']['help'] = $this->t('The vocabulary name.');
+ unset($data['taxonomy_term_field_data']['vid']['field']);
unset($data['taxonomy_term_field_data']['vid']['argument']);
unset($data['taxonomy_term_field_data']['vid']['sort']);
diff --git a/core/modules/taxonomy/src/Tests/Views/TaxonomyFieldVidTest.php b/core/modules/taxonomy/src/Tests/Views/TaxonomyFieldVidTest.php
deleted file mode 100644
index f1ba681..0000000
--- a/core/modules/taxonomy/src/Tests/Views/TaxonomyFieldVidTest.php
+++ /dev/null
@@ -1,44 +0,0 @@
-<?php
-
-/**
- * @file
- * Contains \Drupal\taxonomy\Tests\Views\TaxonomyFieldTidTest.
- */
-
-namespace Drupal\taxonomy\Tests\Views;
-
-use Drupal\Core\Render\RenderContext;
-use Drupal\views\Views;
-use Drupal\taxonomy\Entity\Vocabulary;
-
-/**
- * Tests the taxonomy term VID field handler.
- *
- * @group taxonomy
- */
-class TaxonomyFieldVidTest extends TaxonomyTestBase {
-
- /**
- * Views used by this test.
- *
- * @var array
- */
- public static $testViews = array('test_taxonomy_vid_field');
-
- function testViewsHandlerVidField() {
- /** @var \Drupal\Core\Render\RendererInterface $renderer */
- $renderer = \Drupal::service('renderer');
-
- $view = Views::getView('test_taxonomy_vid_field');
- $this->executeView($view);
-
- $actual = $renderer->executeInRenderContext(new RenderContext(), function () use ($view) {
- return $view->field['vid']->advancedRender($view->result[0]);
- });
- $vocabulary = Vocabulary::load($this->term1->getVocabularyId());
- $expected = $vocabulary->get('name');
-
- $this->assertEqual($expected, $actual);
- }
-
-}
diff --git a/core/modules/taxonomy/src/VocabularyAccessControlHandler.php b/core/modules/taxonomy/src/VocabularyAccessControlHandler.php
deleted file mode 100644
index 29289c6..0000000
--- a/core/modules/taxonomy/src/VocabularyAccessControlHandler.php
+++ /dev/null
@@ -1,37 +0,0 @@
-<?php
-
-/**
- * @file
- * Contains \Drupal\taxonomy\VocabularyAccessControlHandler.
- */
-
-namespace Drupal\taxonomy;
-
-use Drupal\Core\Access\AccessResult;
-use Drupal\Core\Entity\EntityAccessControlHandler;
-use Drupal\Core\Entity\EntityInterface;
-use Drupal\Core\Session\AccountInterface;
-
-/**
- * Defines the access control handler for the taxonomy vocabulary entity type.
- *
- * @see \Drupal\taxonomy\Entity\Vocabulary
- */
-class VocabularyAccessControlHandler extends EntityAccessControlHandler {
-
- /**
- * {@inheritdoc}
- */
- protected function checkAccess(EntityInterface $entity, $operation, AccountInterface $account) {
- switch ($operation) {
- case 'view':
- return AccessResult::allowedIfHasPermission($account, 'access content');
- break;
-
- default:
- return parent::checkAccess($entity, $operation, $account);
- break;
- }
- }
-
-}
diff --git a/core/modules/taxonomy/tests/modules/taxonomy_test_views/test_views/views.view.test_taxonomy_vid_field.yml b/core/modules/taxonomy/tests/modules/taxonomy_test_views/test_views/views.view.test_taxonomy_vid_field.yml
deleted file mode 100644
index ec5ae2d..0000000
--- a/core/modules/taxonomy/tests/modules/taxonomy_test_views/test_views/views.view.test_taxonomy_vid_field.yml
+++ /dev/null
@@ -1,163 +0,0 @@
-langcode: en
-status: true
-dependencies:
- module:
- - taxonomy
- - user
-id: test_taxonomy_vid_field
-label: test_taxonomy_vid_field
-module: views
-description: ''
-tag: ''
-base_table: taxonomy_term_field_data
-base_field: tid
-core: 8.x
-display:
- default:
- display_plugin: default
- id: default
- display_title: Master
- position: 0
- display_options:
- access:
- type: perm
- options:
- perm: 'access content'
- cache:
- type: tag
- options: { }
- query:
- type: views_query
- options:
- disable_sql_rewrite: false
- distinct: false
- replica: false
- query_comment: ''
- query_tags: { }
- exposed_form:
- type: basic
- options:
- submit_button: Apply
- reset_button: false
- reset_button_label: Reset
- exposed_sorts_label: 'Sort by'
- expose_sort_order: true
- sort_asc_label: Asc
- sort_desc_label: Desc
- pager:
- type: full
- options:
- items_per_page: 10
- offset: 0
- id: 0
- total_pages: null
- expose:
- items_per_page: false
- items_per_page_label: 'Items per page'
- items_per_page_options: '5, 10, 25, 50'
- items_per_page_options_all: false
- items_per_page_options_all_label: '- All -'
- offset: false
- offset_label: Offset
- tags:
- previous: '‹ Previous'
- next: 'Next ›'
- first: '« First'
- last: 'Last »'
- quantity: 9
- style:
- type: default
- options:
- grouping: { }
- row_class: ''
- default_row_class: true
- uses_fields: false
- row:
- type: fields
- options:
- inline: { }
- separator: ''
- hide_empty: false
- default_field_elements: true
- fields:
- vid:
- id: vid
- table: taxonomy_term_field_data
- field: vid
- relationship: none
- group_type: group
- admin_label: ''
- label: ''
- exclude: false
- alter:
- alter_text: false
- text: ''
- make_link: false
- path: ''
- absolute: false
- external: false
- replace_spaces: false
- path_case: none
- trim_whitespace: false
- alt: ''
- rel: ''
- link_class: ''
- prefix: ''
- suffix: ''
- target: ''
- nl2br: false
- max_length: 0
- word_boundary: true
- ellipsis: true
- more_link: false
- more_link_text: ''
- more_link_path: ''
- strip_tags: false
- trim: false
- preserve_tags: ''
- html: false
- element_type: ''
- element_class: ''
- element_label_type: ''
- element_label_class: ''
- element_label_colon: false
- element_wrapper_type: ''
- element_wrapper_class: ''
- element_default_classes: true
- empty: ''
- hide_empty: false
- empty_zero: false
- hide_alter_empty: true
- click_sort_column: target_id
- type: entity_reference_label
- settings:
- link: false
- group_column: target_id
- group_columns: { }
- group_rows: true
- delta_limit: 0
- delta_offset: 0
- delta_reversed: false
- delta_first_last: false
- multi_type: separator
- separator: ', '
- field_api_classes: false
- entity_type: taxonomy_term
- entity_field: vid
- plugin_id: field
- filters: { }
- sorts: { }
- header: { }
- footer: { }
- empty: { }
- relationships: { }
- arguments: { }
- display_extenders: { }
- cache_metadata:
- max-age: -1
- contexts:
- - 'languages:language_content'
- - 'languages:language_interface'
- - url.query_args
- - user.permissions
- tags: { }