Commit a8c3e6a1 authored by webchick's avatar webchick

Issue #2128399 by olli: View preview is broken in UI if more link is displayed.

parent 089c38c9
......@@ -7,6 +7,7 @@
namespace Drupal\views\Plugin\views\display;
use Drupal\Component\Utility\String;
use Drupal\Core\Language\Language;
use Drupal\views\Plugin\views\area\AreaPluginBase;
use Drupal\views\ViewExecutable;
......@@ -2482,7 +2483,12 @@ public function renderMoreLink() {
$theme = $this->view->buildThemeFunctions('views_more');
$path = check_url(url($path, $url_options));
return theme($theme, array('more_url' => $path, 'link_text' => check_plain($this->useMoreText()), 'view' => $this->view));
return array(
'#theme' => $theme,
'#more_url' => $path,
'#link_text' => String::checkPlain($this->useMoreText()),
'#view' => $this->view,
);
}
}
}
......
......@@ -187,6 +187,7 @@ public function testReadMore() {
// Test the renderMoreLink method directly. This could be directly unit
// tested.
$more_link = $view->display_handler->renderMoreLink();
$more_link = drupal_render($more_link);
$this->drupalSetContent($more_link);
$result = $this->xpath('//div[@class=:class]/a', array(':class' => 'more-link'));
$this->assertEqual($result[0]->attributes()->href, url('test_display_more'), 'The right more link is shown.');
......
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