core/modules/field/src/Plugin/views/field/Field.php | 2 ++ core/modules/node/src/Tests/Views/NodeLanguageTest.php | 4 +++- core/modules/node/src/Tests/Views/NodeTestBase.php | 8 +++++--- .../taxonomy/src/Plugin/views/relationship/NodeTermData.php | 2 +- .../taxonomy/src/Tests/Views/TaxonomyIndexTidUiTest.php | 11 ++++++----- core/modules/user/src/Plugin/views/access/Role.php | 2 +- 6 files changed, 18 insertions(+), 11 deletions(-) diff --git a/core/modules/field/src/Plugin/views/field/Field.php b/core/modules/field/src/Plugin/views/field/Field.php index 11ce27f..b55d991 100644 --- a/core/modules/field/src/Plugin/views/field/Field.php +++ b/core/modules/field/src/Plugin/views/field/Field.php @@ -947,6 +947,8 @@ public function calculateDependencies() { if ($this->options['type']) { $dependencies['module'][] = $this->formatterPluginManager->getDefinition($this->options['type'])['provider']; } + + return $dependencies; } /** diff --git a/core/modules/node/src/Tests/Views/NodeLanguageTest.php b/core/modules/node/src/Tests/Views/NodeLanguageTest.php index b4d9891..edf5ae8 100644 --- a/core/modules/node/src/Tests/Views/NodeLanguageTest.php +++ b/core/modules/node/src/Tests/Views/NodeLanguageTest.php @@ -10,6 +10,7 @@ use Drupal\field\Entity\FieldStorageConfig; use Drupal\language\Entity\ConfigurableLanguage; use Drupal\views\Plugin\views\PluginBase; +use Drupal\views\Tests\ViewTestData; /** * Tests node language fields, filters, and sorting. @@ -41,11 +42,12 @@ class NodeLanguageTest extends NodeTestBase { * {@inheritdoc} */ protected function setUp() { - parent::setUp(); + parent::setUp(FALSE); // Create Page content type. if ($this->profile != 'standard') { $this->drupalCreateContentType(array('type' => 'page', 'name' => 'Basic page')); + ViewTestData::createTestViews(get_class($this), array('node_test_views')); } // Add two new languages. diff --git a/core/modules/node/src/Tests/Views/NodeTestBase.php b/core/modules/node/src/Tests/Views/NodeTestBase.php index 1c634bb..765f257 100644 --- a/core/modules/node/src/Tests/Views/NodeTestBase.php +++ b/core/modules/node/src/Tests/Views/NodeTestBase.php @@ -22,10 +22,12 @@ */ public static $modules = array('node_test_views'); - protected function setUp() { - parent::setUp(); + protected function setUp($import_test_views = TRUE) { + parent::setUp($import_test_views); - ViewTestData::createTestViews(get_class($this), array('node_test_views')); + if ($import_test_views) { + ViewTestData::createTestViews(get_class($this), array('node_test_views')); + } } } diff --git a/core/modules/taxonomy/src/Plugin/views/relationship/NodeTermData.php b/core/modules/taxonomy/src/Plugin/views/relationship/NodeTermData.php index dc05411..ae325f9 100644 --- a/core/modules/taxonomy/src/Plugin/views/relationship/NodeTermData.php +++ b/core/modules/taxonomy/src/Plugin/views/relationship/NodeTermData.php @@ -110,7 +110,7 @@ public function calculateDependencies() { $dependencies = parent::calculateDependencies(); $vocabulary_storage = \Drupal::entityManager()->getStorage('taxonomy_vocabulary'); - foreach (array_keys($this->options['vid']) as $vocabulary_id) { + foreach (array_keys($this->options['vids']) as $vocabulary_id) { if ($vocabulary = $vocabulary_storage->load($vocabulary_id)) { $dependencies['config'][] = $vocabulary->getConfigDependencyName(); } diff --git a/core/modules/taxonomy/src/Tests/Views/TaxonomyIndexTidUiTest.php b/core/modules/taxonomy/src/Tests/Views/TaxonomyIndexTidUiTest.php index fb4cad2..831ff09 100644 --- a/core/modules/taxonomy/src/Tests/Views/TaxonomyIndexTidUiTest.php +++ b/core/modules/taxonomy/src/Tests/Views/TaxonomyIndexTidUiTest.php @@ -7,6 +7,7 @@ namespace Drupal\taxonomy\Tests\Views; +use Drupal\taxonomy\Entity\Vocabulary; use Drupal\views\Tests\ViewTestData; use Drupal\views_ui\Tests\UITestBase; @@ -38,6 +39,11 @@ class TaxonomyIndexTidUiTest extends UITestBase { protected function setUp() { parent::setUp(); + Vocabulary::create([ + 'vid' => 'tags', + 'name' => 'Tags', + ])->save(); + ViewTestData::createTestViews(get_class($this), array('taxonomy_test_views')); } @@ -45,11 +51,6 @@ protected function setUp() { * Tests the filter UI. */ public function testFilterUI() { - entity_create('taxonomy_vocabulary', array( - 'vid' => 'tags', - 'name' => 'Tags', - ))->save(); - $terms = array(); // Setup a hierarchy which looks like this: // term 0.0 diff --git a/core/modules/user/src/Plugin/views/access/Role.php b/core/modules/user/src/Plugin/views/access/Role.php index a5bad55..1f3b0ab 100644 --- a/core/modules/user/src/Plugin/views/access/Role.php +++ b/core/modules/user/src/Plugin/views/access/Role.php @@ -98,7 +98,7 @@ public function validateOptionsForm(&$form, FormStateInterface $form_state) { public function calculateDependencies() { $dependencies = parent::calculateDependencies(); - $role_storage = \Drupal::entityManager()->getStorage('role'); + $role_storage = \Drupal::entityManager()->getStorage('user_role'); foreach (array_keys($this->options['role']) as $rid) { if ($role = $role_storage->load($rid)) { $dependencies['config'][] = $role->getConfigDependencyName();