diff --git a/core/modules/views/src/Plugin/Block/ViewsBlock.php b/core/modules/views/src/Plugin/Block/ViewsBlock.php index 5aff395..1e25133 100644 --- a/core/modules/views/src/Plugin/Block/ViewsBlock.php +++ b/core/modules/views/src/Plugin/Block/ViewsBlock.php @@ -29,7 +29,7 @@ class ViewsBlock extends ViewsBlockBase { public function build() { $this->view->display_handler->preBlockBuild($this); - if ($output = $this->view->buildRender($this->displayID)) { + if ($output = $this->view->buildRenderable($this->displayID)) { // Override the label to the dynamic title configured in the view. if (empty($this->configuration['views_label']) && $this->view->getTitle()) { $output['#title'] = Xss::filterAdmin($this->view->getTitle()); diff --git a/core/modules/views/src/Plugin/views/display/Attachment.php b/core/modules/views/src/Plugin/views/display/Attachment.php index 56f1d3c..53dfb05 100644 --- a/core/modules/views/src/Plugin/views/display/Attachment.php +++ b/core/modules/views/src/Plugin/views/display/Attachment.php @@ -253,7 +253,7 @@ public function attachTo(ViewExecutable $view, $display_id) { $view->display_handler->setOption('pager', $this->view->displayHandlers->get($display_id)->getOption('pager')); } - $attachment = $view->buildRender($this->display['id'], $args); + $attachment = $view->buildRenderable($this->display['id'], $args); switch ($this->getOption('attachment_position')) { case 'before': diff --git a/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php b/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php index 49d3e4f..6ce67f5 100644 --- a/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php +++ b/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php @@ -2227,7 +2227,7 @@ public function execute() { } * @return array * The render array of a view. */ - public function buildRender(array $args = []) { + public function buildRenderable(array $args = []) { return [ '#type' => 'view', '#name' => $this->view->storage->id(), diff --git a/core/modules/views/src/Routing/ViewPageController.php b/core/modules/views/src/Routing/ViewPageController.php index 9ebaa68..d635ee1 100644 --- a/core/modules/views/src/Routing/ViewPageController.php +++ b/core/modules/views/src/Routing/ViewPageController.php @@ -109,7 +109,7 @@ public function handle(Request $request) { return $view->executeDisplay($display_id, $args); } else { - return $view->buildRender($display_id, $args); + return $view->buildRenderable($display_id, $args); } } diff --git a/core/modules/views/src/ViewExecutable.php b/core/modules/views/src/ViewExecutable.php index bc941fc..2311275 100644 --- a/core/modules/views/src/ViewExecutable.php +++ b/core/modules/views/src/ViewExecutable.php @@ -1411,7 +1411,7 @@ public function render($display_id = NULL) { * A renderable array with #type 'view' or NULL if the display ID was * invalid. */ - public function buildRender($display_id = NULL, $args = array()) { + public function buildRenderable($display_id = NULL, $args = array()) { // @todo Extract that into a generic method. if (empty($this->current_display) || $this->current_display != $this->chooseDisplay($display_id)) { if (!$this->setDisplay($display_id)) { @@ -1419,7 +1419,7 @@ public function buildRender($display_id = NULL, $args = array()) { } } - return $this->display_handler->buildRender($args); + return $this->display_handler->buildRenderable($args); } /** diff --git a/core/modules/views/tests/src/Plugin/Block/ViewsBlockTest.php b/core/modules/views/tests/src/Plugin/Block/ViewsBlockTest.php index 436ef57..baf5bf6 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(['buildRender', 'setDisplay', 'setItemsPerPage']) + ->setMethods(['buildRenderable', 'setDisplay', 'setItemsPerPage']) ->getMock(); $this->executable->expects($this->any()) ->method('setDisplay') @@ -116,7 +116,7 @@ public function testBuild() { $output = $this->randomMachineName(100); $build = array('#markup' => $output); $this->executable->expects($this->once()) - ->method('buildRender') + ->method('buildRenderable') ->with('block_1', []) ->willReturn($build); @@ -142,7 +142,7 @@ public function testBuild() { public function testBuildFailed() { $output = FALSE; $this->executable->expects($this->once()) - ->method('buildRender') + ->method('buildRenderable') ->with('block_1', []) ->willReturn($output); diff --git a/core/modules/views/tests/src/Routing/ViewPageControllerTest.php b/core/modules/views/tests/src/Routing/ViewPageControllerTest.php index 9e42917..3d4e8c0 100644 --- a/core/modules/views/tests/src/Routing/ViewPageControllerTest.php +++ b/core/modules/views/tests/src/Routing/ViewPageControllerTest.php @@ -87,7 +87,7 @@ public function testPageController() { '#display_id' => 'default' ]; $executable->expects($this->once()) - ->method('buildRender') + ->method('buildRenderable') ->with('default', []) ->will($this->returnValue($build)); @@ -141,7 +141,7 @@ public function testHandleWithArgumentsWithoutOverridden() { $executable->argument['test_id'] = $argument; $executable->expects($this->once()) - ->method('buildRender') + ->method('buildRenderable') ->with('page_1', array('test-argument')); $this->executableFactory->expects($this->any()) @@ -196,7 +196,7 @@ public function testHandleWithArgumentsOnOveriddenRoute() { $executable->argument['test_id'] = $argument; $executable->expects($this->once()) - ->method('buildRender') + ->method('buildRenderable') ->with('page_1', array('test-argument')); $this->executableFactory->expects($this->any()) @@ -254,7 +254,7 @@ public function testHandleWithArgumentsOnOveriddenRouteWithUpcasting() { $executable->argument['test_id'] = $argument; $executable->expects($this->once()) - ->method('buildRender') + ->method('buildRenderable') ->with('page_1', array('example_id')); $this->executableFactory->expects($this->any())