Commit 718a47d7 authored by catch's avatar catch

Issue #2309247 by Gábor Hojtsy: Fixed Views do not depend on modules providing their displays.

parent 70bed338
......@@ -38,6 +38,7 @@ display:
id: block_1
display_title: Block
position: null
provider: block
display_options:
field:
title:
......@@ -46,3 +47,6 @@ label: test_view_block
module: views
id: test_view_block
tag: ''
dependencies:
module:
- block
......@@ -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
......@@ -65,3 +68,6 @@ label: test_view_block2
module: views
id: test_view_block2
tag: ''
dependencies:
module:
- block
......@@ -3,6 +3,7 @@ status: true
dependencies:
module:
- comment
- block
id: comments_recent
label: 'Recent comments'
module: views
......@@ -231,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
......
......@@ -9,6 +9,7 @@ display:
id: entity_reference_1
display_title: EntityReference
position: null
provider: entity_reference
display_options:
style:
type: entity_reference
......@@ -116,3 +117,6 @@ module: entity_reference_test
id: test_entity_reference
tag: ''
langcode: en
dependencies:
module:
- entity_reference
......@@ -140,6 +140,7 @@ display:
display_title: Block
display_plugin: block
position: 1
provider: block
display_options:
query:
type: views_query
......@@ -173,3 +174,5 @@ langcode: en
dependencies:
module:
- node
- block
......@@ -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
......@@ -469,3 +470,5 @@ dependencies:
module:
- node
- user
- block
......@@ -40,6 +40,7 @@ display:
id: rest_export_1
display_title: serializer
position: null
provider: rest
display_options:
defaults:
access: false
......@@ -48,3 +49,6 @@ base_field: id
status: true
module: rest
langcode: und
dependencies:
module:
- rest
......@@ -68,6 +68,7 @@ display:
id: rest_export_1
display_title: serializer
position: null
provider: rest
display_options:
defaults:
access: false
......@@ -85,6 +86,7 @@ display:
id: rest_export_2
display_title: 'serialize - access denied'
position: null
provider: rest
display_options:
defaults:
access: false
......@@ -103,3 +105,6 @@ base_field: id
status: true
module: rest
langcode: und
dependencies:
module:
- rest
......@@ -102,6 +102,7 @@ display:
id: rest_export_1
display_title: serializer
position: null
provider: rest
display_options:
defaults:
access: false
......@@ -118,3 +119,6 @@ base_field: nid
status: true
module: rest_test_views
langcode: und
dependencies:
module:
- rest
......@@ -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
......@@ -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
......@@ -115,5 +115,8 @@ views.view.*:
position:
type: integer
label: 'Position'
provider:
type: string
label: 'Display provider module'
display_options:
type: views.display.[%parent.display_plugin]
......@@ -263,6 +263,11 @@ public function calculateDependencies() {
$handler_types[] = $type['plural'];
}
foreach ($this->get('display') as $display) {
// 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) {
if (!empty($display['display_options'][$handler_type])) {
......
......@@ -32,6 +32,7 @@ display:
display_title: Block
id: block_1
position: 2
provider: block
default:
display_options:
access:
......@@ -91,3 +92,6 @@ display:
label: ''
id: test_display
tag: ''
dependencies:
module:
- block
......@@ -30,6 +30,10 @@ display:
id: block_1
display_title: Block
position: 1
provider: block
label: ''
id: test_display_invalid
tag: ''
dependencies:
module:
- block
......@@ -50,6 +50,7 @@ public function testCalculateDependencies($values, $deps) {
}
public function calculateDependenciesProvider(){
$handler['display']['default']['provider'] = 'block';
$handler['display']['default']['display_options']['fields']['example']['dependencies'] = array();
$handler['display']['default']['display_options']['fields']['example2']['dependencies']['module'] = array('views', 'field');
$handler['display']['default']['display_options']['fields']['example3']['dependencies']['module'] = array('views', 'image');
......@@ -60,7 +61,7 @@ public function calculateDependenciesProvider(){
return array(
array(array(), array('node', 'views')),
array($handler, array('field', 'image', 'node', 'views')),
array($handler, array('block', 'field', 'image', 'node', 'views')),
array($plugin, array('field', 'image', 'node', 'views')),
);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment