Issue #2561943 by geertvd, pjonckiere, jhodgdon: Views UI - View Page link on Page display is broken
parent
d7509faee9
commit
2acbaf2574
|
@ -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->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->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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -414,14 +414,13 @@ class ViewEditForm extends ViewFormBase {
|
||||||
elseif ($view->status() && $view->getExecutable()->displayHandlers->get($display['id'])->hasPath()) {
|
elseif ($view->status() && $view->getExecutable()->displayHandlers->get($display['id'])->hasPath()) {
|
||||||
$path = $view->getExecutable()->displayHandlers->get($display['id'])->getPath();
|
$path = $view->getExecutable()->displayHandlers->get($display['id'])->getPath();
|
||||||
if ($path && (strpos($path, '%') === FALSE)) {
|
if ($path && (strpos($path, '%') === FALSE)) {
|
||||||
$uri = "base:$path";
|
|
||||||
if (!parse_url($path, PHP_URL_SCHEME)) {
|
if (!parse_url($path, PHP_URL_SCHEME)) {
|
||||||
// @todo Views should expect and store a leading /. See:
|
// @todo Views should expect and store a leading /. See:
|
||||||
// https://www.drupal.org/node/2423913
|
// https://www.drupal.org/node/2423913
|
||||||
$url = Url::fromUserInput('/' . ltrim($uri, '/'));
|
$url = Url::fromUserInput('/' . ltrim($path, '/'));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$url = Url::fromUri($uri);
|
$url = Url::fromUri("base:$path");
|
||||||
}
|
}
|
||||||
$build['top']['actions']['path'] = array(
|
$build['top']['actions']['path'] = array(
|
||||||
'#type' => 'link',
|
'#type' => 'link',
|
||||||
|
|
Loading…
Reference in New Issue