Revert "-m"

This reverts commit f9ca1c02be.
merge-requests/1654/head
Alex Pott 2018-03-12 12:52:41 +00:00
parent fe1e9a57c4
commit 12a44fc46e
2 changed files with 7 additions and 7 deletions

View File

@ -54,6 +54,9 @@ class EntityReference extends DisplayPluginBase {
$options['row']['contains']['type'] = ['default' => 'entity_reference'];
$options['defaults']['default']['row'] = FALSE;
// Make sure the query is not cached.
$options['defaults']['default']['cache'] = FALSE;
// Set the display title to an empty string (not used in this display type).
$options['title']['default'] = '';
$options['defaults']['default']['title'] = FALSE;
@ -62,12 +65,13 @@ class EntityReference extends DisplayPluginBase {
}
/**
* {@inheritdoc}
* Overrides \Drupal\views\Plugin\views\display\DisplayPluginBase::optionsSummary().
*
* Disable 'cache' and 'title' so it won't be changed.
*/
public function optionsSummary(&$categories, &$options) {
parent::optionsSummary($categories, $options);
// Disable 'title' so it won't be changed from the default set in
// \Drupal\views\Plugin\views\display\EntityReference::defineOptions.
unset($options['query']);
unset($options['title']);
}

View File

@ -125,10 +125,6 @@ class DisplayEntityReferenceTest extends ViewTestBase {
* Tests the entity reference display plugin.
*/
public function testEntityReferenceDisplay() {
// Test that the 'title' settings are not shown.
$this->drupalGet('admin/structure/views/view/test_display_entity_reference/edit/entity_reference_1');
$this->assertSession()->linkByHrefNotExists('admin/structure/views/nojs/display/test_display_entity_reference/entity_reference_1/title');
// Add the new field to the fields.
$this->drupalPostForm('admin/structure/views/nojs/add-handler/test_display_entity_reference/default/field', ['name[entity_test__' . $this->fieldName . '.' . $this->fieldName . ']' => TRUE], t('Add and configure fields'));
$this->drupalPostForm(NULL, [], t('Apply'));