diff --git a/core/modules/views/src/Entity/View.php b/core/modules/views/src/Entity/View.php index 9b97cca..21e4e00 100644 --- a/core/modules/views/src/Entity/View.php +++ b/core/modules/views/src/Entity/View.php @@ -10,6 +10,7 @@ use Drupal\Component\Utility\NestedArray; use Drupal\Core\Config\Entity\ConfigEntityBase; use Drupal\Core\Entity\EntityStorageInterface; +use Drupal\migrate\Plugin\migrate\process\Iterator; use Drupal\views\Views; use Drupal\views\ViewEntityInterface; @@ -266,7 +267,6 @@ public function calculateDependencies() { $executable = $this->getExecutable(); $executable->initDisplay(); - foreach ($executable->displayHandlers as $display) { // Calculate the dependencies each display has. $this->calculatePluginDependencies($display); diff --git a/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php b/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php index 488323d..052f8f2 100644 --- a/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php +++ b/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php @@ -1019,15 +1019,11 @@ protected function getAllPlugins($only_overrides = FALSE) { */ public function calculateDependencies() { $this->addDependencies(parent::calculateDependencies()); - // Collect all dependencies of all handlers. - foreach ($this->getAllHandlers(TRUE) as $handler) { - $this->calculatePluginDependencies($handler); - } + // Collect all the dependencies of handlers and plugins. Only calculate + // their dependencies if they are configured by this display. + $plugins = $this->getAllHandlers(TRUE) + $this->getAllPlugins(TRUE); + array_walk($plugins, array($this, 'calculatePluginDependencies')); - // Collect all dependencies of plugins. - foreach ($this->getAllPlugins(TRUE) as $plugin) { - $this->calculatePluginDependencies($plugin); - } return $this->dependencies; }