Issue #2561943 by geertvd, pjonckiere, jhodgdon: Views UI - View Page link on Page display is broken

8.0.x
Alex Pott 2015-09-09 15:08:10 +01:00
parent d7509faee9
commit 2acbaf2574
2 changed files with 6 additions and 4 deletions

View File

@ -57,7 +57,10 @@ class DisplayPathTest extends UITestBase {
$this->drupalPostForm('admin/structure/views/nojs/display/test_view/page_1/path', array('path' => $random_path), t('Apply'));
$this->assertText('/' . $random_path, 'The custom path appears in the summary.');
$this->assertLink(t('View @display', array('@display' => 'Page')), 0, 'view page link found on the page.');
$display_link_text = t('View @display', ['@display' => 'Page']);
$this->assertLink($display_link_text, 0, 'view page link found on the page.');
$this->clickLink($display_link_text);
$this->assertUrl($random_path);
}
/**

View File

@ -414,14 +414,13 @@ class ViewEditForm extends ViewFormBase {
elseif ($view->status() && $view->getExecutable()->displayHandlers->get($display['id'])->hasPath()) {
$path = $view->getExecutable()->displayHandlers->get($display['id'])->getPath();
if ($path && (strpos($path, '%') === FALSE)) {
$uri = "base:$path";
if (!parse_url($path, PHP_URL_SCHEME)) {
// @todo Views should expect and store a leading /. See:
// https://www.drupal.org/node/2423913
$url = Url::fromUserInput('/' . ltrim($uri, '/'));
$url = Url::fromUserInput('/' . ltrim($path, '/'));
}
else {
$url = Url::fromUri($uri);
$url = Url::fromUri("base:$path");
}
$build['top']['actions']['path'] = array(
'#type' => 'link',