diff --git a/core/modules/views/src/Entity/View.php b/core/modules/views/src/Entity/View.php index 17c8077..448df8b 100644 --- a/core/modules/views/src/Entity/View.php +++ b/core/modules/views/src/Entity/View.php @@ -129,18 +129,6 @@ public function getExecutable() { } /** - * Gets the views data. - * - * @return \Drupal\views\ViewsData - */ - protected function getViewsData() { - if (!isset($this->viewsData)) { - $this->viewsData = Views::viewsData(); - } - return $this->viewsData; - } - - /** * Overrides Drupal\Core\Config\Entity\ConfigEntityBase::createDuplicate(). */ public function createDuplicate() { @@ -304,6 +292,7 @@ public function calculateDependencies() { if (!empty($display['display_options'][$plugin_type]['provider'])) { $this->addDependency('module', $display['display_options'][$plugin_type]['provider']); } + // Add the plugin dependencies. if (!empty($display['display_options'][$plugin_type]['dependencies'])) { $this->addDependencies($display['display_options'][$plugin_type]['dependencies']); } diff --git a/core/modules/views/src/Plugin/views/query/QueryPluginBase.php b/core/modules/views/src/Plugin/views/query/QueryPluginBase.php index 5d3d6bb..538b172 100644 --- a/core/modules/views/src/Plugin/views/query/QueryPluginBase.php +++ b/core/modules/views/src/Plugin/views/query/QueryPluginBase.php @@ -124,9 +124,10 @@ public function getDependencies() { $dependencies = []; foreach ($this->getEntityTableInfo() as $entity_type => $info) { + $dependencies['entity'][] = $entity_type; + if (!empty($info['provider'])) { $dependencies['module'][] = $info['provider']; - $dependencies['entity'][] = $entity_type; } } diff --git a/core/modules/views/src/Plugin/views/relationship/RelationshipPluginBase.php b/core/modules/views/src/Plugin/views/relationship/RelationshipPluginBase.php index 38227a1..a75ffeb 100644 --- a/core/modules/views/src/Plugin/views/relationship/RelationshipPluginBase.php +++ b/core/modules/views/src/Plugin/views/relationship/RelationshipPluginBase.php @@ -163,22 +163,6 @@ public function query() { } } - /** - * {@inheritdoc} - * - * @todo Just remove this and rely on query dependencies? - */ - public function getDependencies() { - $dependencies = array(); - - if (($table_data = Views::viewsData()->get($this->definition['base'])) && isset($table_data['table']['entity type'])) { - $dependencies['entity'][] = $table_data['table']['entity type']; - } - - return $dependencies; - } - - } /** diff --git a/core/modules/views/src/Tests/Entity/ViewEntityDependenciesTest.php b/core/modules/views/src/Tests/Entity/ViewEntityDependenciesTest.php index b317905..a30a84b 100644 --- a/core/modules/views/src/Tests/Entity/ViewEntityDependenciesTest.php +++ b/core/modules/views/src/Tests/Entity/ViewEntityDependenciesTest.php @@ -58,7 +58,8 @@ public function testCalculateDependencies() { 'views_test_data', ), 'test_dependency' => array( - 'row', 'style', + 'row', + 'style', ) ); foreach ($expected as $view_id => $expected_dependencies) {