diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/area/View.php b/core/modules/views/lib/Drupal/views/Plugin/views/area/View.php index 412f19289c8..6fcf82068a1 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/area/View.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/area/View.php @@ -107,7 +107,7 @@ class View extends AreaPluginBase { if (!empty($this->options['view_to_insert'])) { list($view_name, $display_id) = explode(':', $this->options['view_to_insert']); - $view = $this->viewStorage->load($view_name); + $view = $this->viewStorage->load($view_name)->getExecutable(); if (empty($view) || !$view->access($display_id)) { return array(); diff --git a/core/modules/views/lib/Drupal/views/Tests/Handler/AreaViewTest.php b/core/modules/views/lib/Drupal/views/Tests/Handler/AreaViewTest.php new file mode 100644 index 00000000000..a99a3169b6d --- /dev/null +++ b/core/modules/views/lib/Drupal/views/Tests/Handler/AreaViewTest.php @@ -0,0 +1,66 @@ + 'Area: View', + 'description' => 'Tests the view area handler.', + 'group' => 'Views Handlers', + ); + } + + /** + * Tests the view area handler. + */ + public function testViewArea() { + $view = Views::getView('test_area_view'); + + $this->executeView($view); + $output = $view->render(); + $output = drupal_render($output); + $this->assertTrue(strpos($output, 'view-test-simple-argument') !== FALSE, 'The test view is correctly embedded.'); + $view->destroy(); + + $view->setArguments(array(27)); + $this->executeView($view); + $output = $view->render(); + $output = drupal_render($output); + $this->assertTrue(strpos($output, 'John') === FALSE, 'The test view is correctly embedded with inherited arguments.'); + $this->assertTrue(strpos($output, 'George') !== FALSE, 'The test view is correctly embedded with inherited arguments.'); + $view->destroy(); + } + +} diff --git a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_area_view.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_area_view.yml new file mode 100644 index 00000000000..ffd51734eec --- /dev/null +++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_area_view.yml @@ -0,0 +1,50 @@ +base_table: views_test_data +core: '8' +description: '' +status: '1' +display: + default: + display_options: + defaults: + fields: '0' + pager: '0' + pager_options: '0' + sorts: '0' + fields: + id: + field: id + id: id + relationship: none + table: views_test_data + plugin_id: numeric + provider: views_test_data + pager: + options: + offset: '0' + type: none + pager_options: { } + sorts: + id: + field: id + id: id + order: ASC + relationship: none + table: views_test_data + plugin_id: numeric + provider: views_test_data + header: + view: + field: view + id: view + table: views + view_to_insert: test_simple_argument:default + inherit_arguments: 1 + plugin_id: view + provider: views + display_plugin: default + display_title: Master + id: default + position: '0' +label: '' +id: test_area_view +tag: ''