Commit 9f85d565 authored by alexpott's avatar alexpott

Issue #2501937 by stefan.r, Cottser, pjonckiere, akalata: Remove...

Issue #2501937 by stefan.r, Cottser, pjonckiere, akalata: Remove SafeMarkup::set in ViewsUIController::reportFields()
parent c7d4ab58
......@@ -93,7 +93,12 @@ public function reportFields() {
foreach ($views as $view) {
$rows[$field_name]['data'][1][] = $this->l($view, new Url('entity.view.edit_form', array('view' => $view)));
}
$rows[$field_name]['data'][1] = SafeMarkup::set(implode(', ', $rows[$field_name]['data'][1]));
$item_list = [
'#theme' => 'item_list',
'#items' => $rows[$field_name]['data'][1],
'#context' => ['list_style' => 'comma-list'],
];
$rows[$field_name]['data'][1] = ['data' => $item_list];
}
// Sort rows by field name.
......
<?php
/**
* @file
* Contains \Drupal\views_ui\Tests\ReportFieldsTest.
*/
namespace Drupal\views_ui\Tests;
use Drupal\field\Entity\FieldConfig;
use Drupal\field\Entity\FieldStorageConfig;
/**
* Tests the Views fields report page.
*
* @group views_ui
*/
class ReportFieldsTest extends UITestBase {
/**
* {@inheritdoc}
*/
public static $testViews = ['test_field_field_test'];
/**
* {@inheritdoc}
*/
public static $modules = ['entity_test'];
/**
* Tests the Views fields report page.
*/
public function testReportFields() {
$this->drupalGet('admin/reports/fields/views-fields');
$this->assertRaw('Used in views', 'Title appears correctly');
$this->assertRaw('No fields have been used in views yet.', 'No results message appears correctly.');
// Set up the field_test field.
$field_storage = FieldStorageConfig::create([
'field_name' => 'field_test',
'type' => 'integer',
'entity_type' => 'entity_test',
]);
$field_storage->save();
$field = FieldConfig::create([
'field_name' => 'field_test',
'entity_type' => 'entity_test',
'bundle' => 'entity_test',
]);
$field->save();
$this->drupalGet('admin/reports/fields/views-fields');
// Assert that the newly created field appears in the overview.
$this->assertRaw('<td>field_test</td>', 'Field name appears correctly');
$this->assertRaw('>test_field_field_test</a>', 'View name appears correctly');
$this->assertRaw('Used in views', 'Title appears correctly');
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment