diff --git a/core/modules/views/lib/Drupal/views/Plugin/Block/ViewsBlock.php b/core/modules/views/lib/Drupal/views/Plugin/Block/ViewsBlock.php index 277fac1..308f7b8 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/Block/ViewsBlock.php +++ b/core/modules/views/lib/Drupal/views/Plugin/Block/ViewsBlock.php @@ -192,9 +192,7 @@ protected function addContextualLinks(&$output, $block_type = 'block') { $output = array('#markup' => $output); } // Add the contextual links. - if (function_exists('views_add_contextual_links')) { - views_add_contextual_links($output, $block_type, $this->view, $this->displayID); - } + views_add_contextual_links($output, $block_type, $this->view, $this->displayID); } } diff --git a/core/modules/views/tests/Drupal/views/Tests/Plugin/Block/ViewsBlockTest.php b/core/modules/views/tests/Drupal/views/Tests/Plugin/Block/ViewsBlockTest.php index 65d4171..1f9dac3 100644 --- a/core/modules/views/tests/Drupal/views/Tests/Plugin/Block/ViewsBlockTest.php +++ b/core/modules/views/tests/Drupal/views/Tests/Plugin/Block/ViewsBlockTest.php @@ -116,6 +116,9 @@ public function testBuild() { ->method('executeDisplay') ->with($this->equalTo('block_1')) ->will($this->returnValue($build)); + $this->executable->expects($this->once()) + ->method('destroy') + ->will($this->returnValue(TRUE)); $this->executable->expects($this->once()) ->method('destroy') @@ -199,11 +202,16 @@ public function testBuildOverride() { } -// @todo Remove this once t() is converted to a service. +// @todo Remove this once https://drupal.org/node/2018411 is in. namespace { if (!function_exists('t')) { function t($string) { return $string; } } + // @todo replace views_add_contextual_links() + if (!function_exists('views_add_contextual_links')) { + function views_add_contextual_links() { + } + } }