Skip to content
Snippets Groups Projects
Commit 28088f38 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #2550287 by cilefen, hexabinaer, legolasbo, dawehner: Expand display...

Issue #2550287 by cilefen, hexabinaer, legolasbo, dawehner: Expand display "Comment" trim from 10 to 80 characters
parent 70880e91
No related branches found
No related tags found
No related merge requests found
......@@ -9,7 +9,6 @@
use Drupal\Component\Plugin\DependentPluginInterface;
use Drupal\Component\Utility\Html;
use Drupal\Component\Utility\Unicode;
use Drupal\Component\Utility\SafeMarkup;
use Drupal\Core\Cache\Cache;
use Drupal\Core\Cache\CacheableMetadata;
......@@ -1130,7 +1129,7 @@ public function optionsSummary(&$categories, &$options) {
);
}
$display_comment = Unicode::substr($this->getOption('display_comment'), 0, 10);
$display_comment = views_ui_truncate($this->getOption('display_comment'), 80);
$options['display_comment'] = array(
'category' => 'other',
'title' => $this->t('Administrative comment'),
......
......@@ -45,13 +45,18 @@ public function testDeleteLink() {
}
/**
* Tests the machine name form.
* Tests the machine name and administrative comment forms.
*/
public function testMachineNameOption() {
public function testOtherOptions() {
$this->drupalGet('admin/structure/views/view/test_view');
// Add a new attachment display.
$this->drupalPostForm(NULL, array(), 'Add Attachment');
// Test that a long administrative comment is truncated.
$edit = array('display_comment' => 'one two three four five six seven eight nine ten eleven twelve thirteen fourteen fifteen');
$this->drupalPostForm('admin/structure/views/nojs/display/test_view/attachment_1/display_comment', $edit, 'Apply');
$this->assertText('one two three four five six seven eight nine ten eleven twelve thirteen fourteen...');
// Change the machine name for the display from page_1 to test_1.
$edit = array('display_id' => 'test_1');
$this->drupalPostForm('admin/structure/views/nojs/display/test_view/attachment_1/display_id', $edit, 'Apply');
......
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