Skip to content
Snippets Groups Projects
Commit b70ee4b4 authored by catch's avatar catch
Browse files

Issue #1831142 by damiankloip, dawehner: Fixed Path is never empty in option summary.

parent 962d4503
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -219,9 +219,13 @@ public function optionsSummary(&$categories, &$options) {
),
);
$path = strip_tags('/' . $this->getOption('path'));
$path = strip_tags($this->getOption('path'));
if (empty($path)) {
$path = t('None');
$path = t('No path is set');
}
else {
$path = '/' . $path;
}
$options['path'] = array(
......
<?php
/**
* @file
* Contains \Drupal\views\Tests\UI\DisplayPath
*/
namespace Drupal\views\Tests\UI;
/**
* Tests the UI of generic display path plugin.
*
* @see \Drupal\views\Plugin\views\display\PathPluginBase
*/
class DisplayPath extends UITestBase {
public static function getInfo() {
return array(
'name' => 'Display Path: UI',
'description' => 'Tests the UI of generic display path plugin.',
'group' => 'Views UI',
);
}
public function testPathUI() {
$this->drupalGet('admin/structure/views/view/test_view');
// 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.');
// 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.');
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment