diff --git a/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php b/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php index b635f00..294aa2b 100644 --- a/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php +++ b/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php @@ -2208,8 +2208,6 @@ public function preExecute() { foreach ($this->extender as $extender) { $extender->preExecute(); } - - $this->view->setShowAdminLinks($this->getOption('show_admin_links')); } /** diff --git a/core/modules/views/src/ViewExecutable.php b/core/modules/views/src/ViewExecutable.php index 74e1bf7..be60c27 100644 --- a/core/modules/views/src/ViewExecutable.php +++ b/core/modules/views/src/ViewExecutable.php @@ -1401,8 +1401,13 @@ public function render($display_id = NULL) { * This render array has a #pre_render callback which will call * ::executeDisplay in order to actually execute the view etc. * - * @TODO Bikesheed the name. - * @TODO Do we support $args and if how? + * @param string $display_id + * The display ID. + * @param array $args + * An array of arguments passed along to the view. + * + * @return array|null + * A renderable array with #type 'view'. */ public function buildRenderForDisplay($display_id = NULL, $args = array()) { // @todo Extract that into a generic method. @@ -2102,6 +2107,9 @@ public function setShowAdminLinks($show_admin_links) { * Returns TRUE if admin links should be rendered, else FALSE. */ public function getShowAdminLinks() { + if (!isset($this->showAdminLinks)) { + return $this->getDisplay()->getOption('show_admin_links'); + } return $this->showAdminLinks; } diff --git a/core/modules/views/tests/src/Plugin/Block/ViewsBlockTest.php b/core/modules/views/tests/src/Plugin/Block/ViewsBlockTest.php index 662d6f5..aac341b 100644 --- a/core/modules/views/tests/src/Plugin/Block/ViewsBlockTest.php +++ b/core/modules/views/tests/src/Plugin/Block/ViewsBlockTest.php @@ -72,7 +72,7 @@ protected function setUp() { $this->executable = $this->getMockBuilder('Drupal\views\ViewExecutable') ->disableOriginalConstructor() - ->setMethods(array('buildRenderForDisplay', 'setDisplay', 'setItemsPerPage')) + ->setMethods(['buildRenderForDisplay', 'setDisplay', 'setItemsPerPage']) ->getMock(); $this->executable->expects($this->any()) ->method('setDisplay') @@ -117,7 +117,7 @@ public function testBuild() { $build = array('#markup' => $output); $this->executable->expects($this->once()) ->method('buildRenderForDisplay') - ->with('block_1', array()) + ->with('block_1', []) ->willReturn($build); $block_id = 'views_block:test_view-block_1'; @@ -143,7 +143,7 @@ public function testBuildFailed() { $output = FALSE; $this->executable->expects($this->once()) ->method('buildRenderForDisplay') - ->with('block_1', array()) + ->with('block_1', []) ->willReturn($output); $block_id = 'views_block:test_view-block_1'; diff --git a/core/modules/views/views.module b/core/modules/views/views.module index 31d25b8..e37a118 100644 --- a/core/modules/views/views.module +++ b/core/modules/views/views.module @@ -50,7 +50,6 @@ function views_help($route_name, RouteMatchInterface $route_match) { * Implements hook_element_info(). */ function views_element_info() { - // @TODO consider to namespace that element. $types['view'] = array( '#theme_wrappers' => array('container'), '#pre_render' => array('views_pre_render_view_element'),