Issue #1831696 by dawehner, damiankloip | Bojhan: Fixed View page link goes nowhere, if you have not saved.
parent
53532e96c9
commit
763caef922
|
@ -35,11 +35,13 @@ class DisplayPath extends UITestBase {
|
|||
// Add a new page display and check the appearing text.
|
||||
$this->drupalPost(NULL, array(), 'Add Page');
|
||||
$this->assertText(t('No path is set'), 'The right text appears if no path was set.');
|
||||
$this->assertNoLink(t('view @display', array('@display' => 'page')), 'No view page link found on the page.');
|
||||
|
||||
// Save a path and make sure the summary appears as expected.
|
||||
$random_path = $this->randomName();
|
||||
$this->drupalPost("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.');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -376,10 +376,11 @@ class ViewEditFormController extends ViewFormControllerBase {
|
|||
"#suffix" => '</li>',
|
||||
);
|
||||
}
|
||||
// Add a link to view the page.
|
||||
elseif ($view->get('executable')->displayHandlers->get($display['id'])->hasPath()) {
|
||||
// Add a link to view the page unless the view is disabled or has no
|
||||
// path.
|
||||
elseif ($view->status() && $view->get('executable')->displayHandlers->get($display['id'])->hasPath()) {
|
||||
$path = $view->get('executable')->displayHandlers->get($display['id'])->getPath();
|
||||
if (strpos($path, '%') === FALSE) {
|
||||
if ($path && (strpos($path, '%') === FALSE)) {
|
||||
$build['top']['actions']['path'] = array(
|
||||
'#type' => 'link',
|
||||
'#title' => t('view @display', array('@display' => $display['display_title'])),
|
||||
|
@ -409,16 +410,6 @@ class ViewEditFormController extends ViewFormControllerBase {
|
|||
'#prefix' => '<li class="delete">',
|
||||
"#suffix" => '</li>',
|
||||
);
|
||||
if ($is_enabled) {
|
||||
$build['top']['actions']['disable'] = array(
|
||||
'#type' => 'submit',
|
||||
'#value' => t('disable @display_title', array('@display_title' => $display_title)),
|
||||
'#limit_validation_errors' => array(),
|
||||
'#submit' => array(array($this, 'submitDisplayDisable'), array($this, 'submitDelayDestination')),
|
||||
'#prefix' => '<li class="disable">',
|
||||
"#suffix" => '</li>',
|
||||
);
|
||||
}
|
||||
|
||||
foreach (views_fetch_plugin_names('display', NULL, array($view->get('storage')->get('base_table'))) as $type => $label) {
|
||||
if ($type == $display['display_plugin']) {
|
||||
|
@ -445,6 +436,16 @@ class ViewEditFormController extends ViewFormControllerBase {
|
|||
"#suffix" => '</li>',
|
||||
);
|
||||
}
|
||||
if ($is_enabled) {
|
||||
$build['top']['actions']['disable'] = array(
|
||||
'#type' => 'submit',
|
||||
'#value' => t('disable @display_title', array('@display_title' => $display_title)),
|
||||
'#limit_validation_errors' => array(),
|
||||
'#submit' => array(array($this, 'submitDisplayDisable'), array($this, 'submitDelayDestination')),
|
||||
'#prefix' => '<li class="disable">',
|
||||
"#suffix" => '</li>',
|
||||
);
|
||||
}
|
||||
$build['top']['actions']['suffix']['#markup'] = '</ul>';
|
||||
|
||||
// The area above the three columns.
|
||||
|
|
Loading…
Reference in New Issue