diff --git a/core/modules/taxonomy/src/Plugin/views/argument_default/Tid.php b/core/modules/taxonomy/src/Plugin/views/argument_default/Tid.php index a1496c2..e1aae9d 100644 --- a/core/modules/taxonomy/src/Plugin/views/argument_default/Tid.php +++ b/core/modules/taxonomy/src/Plugin/views/argument_default/Tid.php @@ -234,4 +234,16 @@ public function getCacheContexts() { return ['cache.context.url']; } + /** + * {@inheritdoc} + */ + public function calculateDependencies() { + $dependencies = parent::calculateDependencies(); + + foreach ($this->vocabularyStorage->loadMultiple(array_keys($this->options['vids'])) as $vocabulary) { + $dependencies[$vocabulary->getConfigDependencyKey()][] = $vocabulary->getConfigDependencyName(); + } + return $dependencies; + } + } diff --git a/core/modules/user/src/Plugin/views/argument_validator/User.php b/core/modules/user/src/Plugin/views/argument_validator/User.php index 0cf7ad9..20b94f4 100644 --- a/core/modules/user/src/Plugin/views/argument_validator/User.php +++ b/core/modules/user/src/Plugin/views/argument_validator/User.php @@ -101,4 +101,18 @@ protected function validateEntity(EntityInterface $entity) { return $role_check_success && parent::validateEntity($entity); } + /** + * {@inheritdoc} + */ + public function calculateDependencies() { + $dependencies = parent::calculateDependencies(); + + foreach ($this->entityManager->getStorage('user_role')->loadMultiple(array_keys($this->options['roles'])) as $role) { + $dependencies[$role->getConfigDependencyKey()][] = $role->getConfigDependencyName(); + } + + return $dependencies; + } + + } diff --git a/core/modules/views/src/Plugin/views/argument/ArgumentPluginBase.php b/core/modules/views/src/Plugin/views/argument/ArgumentPluginBase.php index 785e024..698c786 100644 --- a/core/modules/views/src/Plugin/views/argument/ArgumentPluginBase.php +++ b/core/modules/views/src/Plugin/views/argument/ArgumentPluginBase.php @@ -7,6 +7,8 @@ namespace Drupal\views\Plugin\views\argument; +use Drupal\Component\Plugin\DependentPluginInterface; +use Drupal\Component\Utility\NestedArray; use Drupal\Component\Utility\String as UtilityString; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Render\Element; @@ -1223,6 +1225,24 @@ public function getCacheContexts() { return $contexts; } + /** + * {@inheritdoc} + */ + public function calculateDependencies() { + $dependencies = []; + if (($argument_default = $this->getPlugin('argument_default')) && $argument_default instanceof DependentPluginInterface) { + $dependencies = NestedArray::mergeDeep($dependencies, $argument_default->calculateDependencies()); + } + if (($argument_validator = $this->getPlugin('argument_validator')) && $argument_validator instanceof DependentPluginInterface) { + $dependencies = NestedArray::mergeDeep($dependencies, $argument_validator->calculateDependencies()); + } + if (($style = $this->getPlugin('style')) && $style instanceof DependentPluginInterface) { + $dependencies = NestedArray::mergeDeep($dependencies, $style->calculateDependencies()); + } + + return $dependencies; + } + } /** diff --git a/core/modules/views/src/Plugin/views/argument_validator/Entity.php b/core/modules/views/src/Plugin/views/argument_validator/Entity.php index 110b5bb..7c7eed3 100644 --- a/core/modules/views/src/Plugin/views/argument_validator/Entity.php +++ b/core/modules/views/src/Plugin/views/argument_validator/Entity.php @@ -222,8 +222,7 @@ public function calculateDependencies() { $bundle_entity_type = $this->entityManager->getDefinition($entity_type_id)->getBundleEntityType(); $bundle_entity_storage = $this->entityManager->getStorage($bundle_entity_type); - foreach (array_keys($this->options['bundles']) as $bundle) { - $bundle_entity = $bundle_entity_storage->load($bundle); + foreach ($bundle_entity_storage->loadMultiple(array_keys($this->options['bundles'])) as $bundle_entity) { $dependencies[$bundle_entity->getConfigDependencyKey()][] = $bundle_entity->getConfigDependencyName(); }