diff --git a/core/modules/block/src/Plugin/views/display/Block.php b/core/modules/block/src/Plugin/views/display/Block.php index af817a2..9ee2ca9 100644 --- a/core/modules/block/src/Plugin/views/display/Block.php +++ b/core/modules/block/src/Plugin/views/display/Block.php @@ -328,11 +328,4 @@ public function remove() { } } - /** - * @inheritdoc - */ - public function getDependencies() { - return array('module' => array('block')); - } - } diff --git a/core/modules/block/tests/modules/block_test_views/test_views/views.view.test_view_block.yml b/core/modules/block/tests/modules/block_test_views/test_views/views.view.test_view_block.yml index 07a7187..e16db6b 100644 --- a/core/modules/block/tests/modules/block_test_views/test_views/views.view.test_view_block.yml +++ b/core/modules/block/tests/modules/block_test_views/test_views/views.view.test_view_block.yml @@ -38,6 +38,7 @@ display: id: block_1 display_title: Block position: null + provider: block display_options: field: title: diff --git a/core/modules/block/tests/modules/block_test_views/test_views/views.view.test_view_block2.yml b/core/modules/block/tests/modules/block_test_views/test_views/views.view.test_view_block2.yml index a292514..45750f4 100644 --- a/core/modules/block/tests/modules/block_test_views/test_views/views.view.test_view_block2.yml +++ b/core/modules/block/tests/modules/block_test_views/test_views/views.view.test_view_block2.yml @@ -34,6 +34,7 @@ display: provider: views_test_data title: test_view_block2 block_1: + provider: block display_plugin: block id: block_1 display_title: Block @@ -43,6 +44,7 @@ display: title: link_to_node: true block_2: + provider: block display_plugin: block id: block_2 display_title: Block @@ -52,6 +54,7 @@ display: title: link_to_node: true block_3: + provider: block display_plugin: block id: block_3 display_title: Block diff --git a/core/modules/comment/config/install/views.view.comments_recent.yml b/core/modules/comment/config/install/views.view.comments_recent.yml index 5ffda27..674c8a8 100644 --- a/core/modules/comment/config/install/views.view.comments_recent.yml +++ b/core/modules/comment/config/install/views.view.comments_recent.yml @@ -232,6 +232,7 @@ display: field_langcode: '***CURRENT_LANGUAGE***' field_langcode_add_to_query: null block_1: + provider: block display_plugin: block id: block_1 display_title: Block diff --git a/core/modules/node/config/install/views.view.archive.yml b/core/modules/node/config/install/views.view.archive.yml index 70b6084..e83b8e1 100644 --- a/core/modules/node/config/install/views.view.archive.yml +++ b/core/modules/node/config/install/views.view.archive.yml @@ -140,6 +140,7 @@ display: display_title: Block display_plugin: block position: 1 + provider: block display_options: query: type: views_query diff --git a/core/modules/node/config/install/views.view.content_recent.yml b/core/modules/node/config/install/views.view.content_recent.yml index 56f2a67..726628d 100644 --- a/core/modules/node/config/install/views.view.content_recent.yml +++ b/core/modules/node/config/install/views.view.content_recent.yml @@ -460,6 +460,7 @@ display: display_options: link_url: admin/content block_category: 'Lists (Views)' + provider: block label: 'Recent content' module: node id: content_recent diff --git a/core/modules/user/config/install/views.view.who_s_new.yml b/core/modules/user/config/install/views.view.who_s_new.yml index 7aa3a5d..0abe6e5 100644 --- a/core/modules/user/config/install/views.view.who_s_new.yml +++ b/core/modules/user/config/install/views.view.who_s_new.yml @@ -162,6 +162,7 @@ display: id: block_1 display_title: 'Who''s new' position: 1 + provider: block display_options: display_description: 'A list of new users' block_description: 'Who''s new' @@ -174,3 +175,4 @@ langcode: en dependencies: module: - user + - block diff --git a/core/modules/user/config/install/views.view.who_s_online.yml b/core/modules/user/config/install/views.view.who_s_online.yml index 3b92c49..6040d38 100644 --- a/core/modules/user/config/install/views.view.who_s_online.yml +++ b/core/modules/user/config/install/views.view.who_s_online.yml @@ -193,6 +193,7 @@ display: id: who_s_online_block display_title: 'Who''s online' position: 1 + provider: block display_options: block_description: 'Who''s online' display_description: 'A list of users that are currently logged in.' @@ -204,3 +205,4 @@ langcode: en dependencies: module: - user + - block diff --git a/core/modules/views/src/Entity/View.php b/core/modules/views/src/Entity/View.php index 7fc0828..0f783ff 100644 --- a/core/modules/views/src/Entity/View.php +++ b/core/modules/views/src/Entity/View.php @@ -263,8 +263,10 @@ public function calculateDependencies() { $handler_types[] = $type['plural']; } foreach ($this->get('display') as $display) { - // Collect dependencies for the display itself. - $this->addDependencies($display->getDependencies()); + // Add dependency for the display itself. + if (isset($display['provider'])) { + $this->addDependency('module', $display['provider']); + } // Collect all dependencies of all handlers. foreach ($handler_types as $handler_type) { diff --git a/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php b/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php index e9bc880..3d3d6a5 100644 --- a/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php +++ b/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php @@ -2507,16 +2507,6 @@ protected function mergeHandler($type) { $this->setOption($types[$type]['plural'], $options); } - /** - * Returns dependencies (modules, entities) for this views display. - * - * @return array - * A list of dependencies for this display. - */ - public function getDependencies() { - return array(); - } - } /** diff --git a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_display.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_display.yml index fe5f5cb..840d874 100644 --- a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_display.yml +++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_display.yml @@ -32,6 +32,7 @@ display: display_title: Block id: block_1 position: 2 + provider: block default: display_options: access: diff --git a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_display_invalid.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_display_invalid.yml index 65807a0..638c3f5 100644 --- a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_display_invalid.yml +++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_display_invalid.yml @@ -30,6 +30,7 @@ display: id: block_1 display_title: Block position: 1 + provider: block label: '' id: test_display_invalid tag: ''