Commit b8378ac5 authored by alexpott's avatar alexpott

Issue #2094499 by amateescu: Convert "Manage (form) display" forms to be the...

Issue #2094499 by amateescu: Convert "Manage (form) display" forms to be the official entity edit forms for EntityView[Form]Display objects
parent 17bf38b9
......@@ -54,9 +54,6 @@ core.entity_view_display.*.*.*:
id:
type: string
label: 'ID'
label:
type: label
label: 'Label'
targetEntityType:
type: string
label: 'Target entity type'
......
......@@ -399,6 +399,7 @@ public function __sleep() {
// Only store the definition, not external objects or derived data.
$keys = array_keys($this->toArray());
$keys[] = 'entityTypeId';
$keys[] = 'enforceIsNew';
return $keys;
}
......@@ -408,7 +409,9 @@ public function __sleep() {
public function __wakeup() {
// Run the values from self::toArray() through __construct().
$values = array_intersect_key($this->toArray(), get_object_vars($this));
$is_new = $this->isNew();
$this->__construct($values, $this->entityTypeId);
$this->enforceIsNew($is_new);
}
}
......@@ -8,7 +8,6 @@ dependencies:
- text
- user
id: node.book.default
label: null
targetEntityType: node
bundle: book
mode: default
......
......@@ -9,7 +9,6 @@ dependencies:
- text
- user
id: node.book.teaser
label: null
targetEntityType: node
bundle: book
mode: teaser
......
......@@ -11,6 +11,7 @@
use Drupal\Core\Render\Element;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Entity\EntityViewModeInterface;
use Drupal\Core\Url;
use Drupal\field_ui\FieldUI;
use Drupal\field_ui\Plugin\Derivative\FieldUiLocalTask;
......@@ -68,6 +69,8 @@ function field_ui_entity_type_build(array &$entity_types) {
$entity_types['field_config']->setListBuilderClass('Drupal\field_ui\FieldConfigListBuilder');
$entity_types['field_storage_config']->setListBuilderClass('Drupal\field_ui\FieldStorageConfigListBuilder');
$entity_types['field_storage_config']->setLinkTemplate('collection', '/admin/reports/fields');
$entity_types['entity_form_display']->setFormClass('edit', 'Drupal\field_ui\Form\EntityFormDisplayEditForm');
$entity_types['entity_view_display']->setFormClass('edit', 'Drupal\field_ui\Form\EntityViewDisplayEditForm');
foreach ($entity_types as $entity_type) {
if ($bundle = $entity_type->getBundleOf()) {
......@@ -76,9 +79,7 @@ function field_ui_entity_type_build(array &$entity_types) {
// This allows us to not require route information inside this hook, which
// otherwise could result in circular dependencies.
$entity_type
->setLinkTemplate('field_ui-fields', "/admin/{$entity_type->id()}/fields")
->setLinkTemplate('field_ui-form-display', "/admin/{$entity_type->id()}/fields-form-display")
->setLinkTemplate('field_ui-display', "/admin/{$entity_type->id()}/fields-display");
->setLinkTemplate('field_ui-fields', "/admin/{$entity_type->id()}/fields");
}
}
}
......@@ -143,14 +144,18 @@ function field_ui_entity_operation(EntityInterface $entity) {
$operations['manage-form-display'] = array(
'title' => t('Manage form display'),
'weight' => 20,
'url' => $entity->urlInfo('field_ui-form-display'),
'url' => Url::fromRoute("entity.entity_form_display.{$entity->getEntityTypeId()}.default", array(
$entity->getEntityTypeId() => $entity->id(),
)),
);
}
if ($account->hasPermission('administer '. $bundle_of . ' display')) {
$operations['manage-display'] = array(
'title' => t('Manage display'),
'weight' => 25,
'url' => $entity->urlInfo('field_ui-display'),
'url' => Url::fromRoute("entity.entity_view_display.{$entity->getEntityTypeId()}.default", array(
$entity->getEntityTypeId() => $entity->id(),
)),
);
}
}
......
......@@ -2,97 +2,48 @@
/**
* @file
* Contains \Drupal\field_ui\FormDisplayOverview.
* Contains \Drupal\field_ui\Form\EntityFormDisplayEditForm.
*/
namespace Drupal\field_ui;
namespace Drupal\field_ui\Form;
use Drupal\Component\Plugin\PluginManagerBase;
use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Entity\Display\EntityDisplayInterface;
use Drupal\Core\Entity\EntityManagerInterface;
use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\Field\FieldDefinitionInterface;
use Drupal\Core\Field\FieldTypePluginManager;
use Drupal\Core\Field\PluginSettingsInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Url;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* Field UI form display overview form.
* Edit form for the EntityFormDisplay entity type.
*/
class FormDisplayOverview extends DisplayOverviewBase {
class EntityFormDisplayEditForm extends EntityDisplayFormBase {
/**
* {@inheritdoc}
*/
protected $displayContext = 'form';
/**
* Stores the module manager.
*
* @var \Drupal\Core\Extension\ModuleHandlerInterface
*/
protected $moduleHandler;
/**
* Constructs a new class instance.
*
* @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
* The entity manager.
* @param \Drupal\Core\Field\FieldTypePluginManager $field_type_manager
* The field type manager.
* @param \Drupal\Component\Plugin\PluginManagerBase $plugin_manager
* The widget or formatter plugin manager.
* @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
* The module handler to use for invoking hooks.
* @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
* The configuration factory.
*/
public function __construct(EntityManagerInterface $entity_manager, FieldTypePluginManager $field_type_manager, PluginManagerBase $plugin_manager, ModuleHandlerInterface $module_handler, ConfigFactoryInterface $config_factory) {
parent::__construct($entity_manager, $field_type_manager, $plugin_manager, $config_factory);
$this->moduleHandler = $module_handler;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container) {
return new static(
$container->get('entity.manager'),
$container->get('plugin.manager.field.field_type'),
$container->get('plugin.manager.field.widget'),
$container->get('module_handler'),
$container->get('config.factory')
$container->get('plugin.manager.field.widget')
);
}
/**
* {@inheritdoc}
*/
public function getFormId() {
return 'field_ui_form_display_overview_form';
}
/**
* {@inheritdoc}
*/
public function buildForm(array $form, FormStateInterface $form_state, $entity_type_id = NULL, $bundle = NULL, $form_mode_name = 'default') {
return parent::buildForm($form, $form_state, $entity_type_id, $bundle, $form_mode_name);
}
/**
* {@inheritdoc}
*/
protected function buildFieldRow(FieldDefinitionInterface $field_definition, EntityDisplayInterface $entity_display, array $form, FormStateInterface $form_state) {
$field_row = parent::buildFieldRow($field_definition, $entity_display, $form, $form_state);
protected function buildFieldRow(FieldDefinitionInterface $field_definition, array $form, FormStateInterface $form_state) {
$field_row = parent::buildFieldRow($field_definition, $form, $form_state);
$field_name = $field_definition->getName();
// Update the (invisible) title of the 'plugin' column.
$field_row['plugin']['#title'] = $this->t('Formatter for @title', array('@title' => $field_definition->getLabel()));
if (!empty($field_row['plugin']['settings_edit_form']) && ($plugin = $entity_display->getRenderer($field_name))) {
if (!empty($field_row['plugin']['settings_edit_form']) && ($plugin = $this->entity->getRenderer($field_name))) {
$plugin_type_info = $plugin->getPluginDefinition();
$field_row['plugin']['settings_edit_form']['label']['#markup'] = $this->t('Widget settings:') . ' <span class="plugin-name">' . $plugin_type_info['label'] . '</span>';
}
......@@ -103,8 +54,8 @@ protected function buildFieldRow(FieldDefinitionInterface $field_definition, Ent
/**
* {@inheritdoc}
*/
protected function getEntityDisplay($mode) {
return entity_get_form_display($this->entity_type, $this->bundle, $mode);
protected function getEntityDisplay($entity_type_id, $bundle, $mode) {
return entity_get_form_display($entity_type_id, $bundle, $mode);
}
/**
......@@ -116,7 +67,7 @@ protected function getPlugin(FieldDefinitionInterface $field_definition, $config
if ($configuration && $configuration['type'] != 'hidden') {
$plugin = $this->pluginManager->getInstance(array(
'field_definition' => $field_definition,
'form_mode' => $this->mode,
'form_mode' => $this->entity->mode,
'configuration' => $configuration
));
}
......@@ -124,13 +75,6 @@ protected function getPlugin(FieldDefinitionInterface $field_definition, $config
return $plugin;
}
/**
* {@inheritdoc}
*/
protected function getPluginOptions(FieldDefinitionInterface $field_definition) {
return parent::getPluginOptions($field_definition) + array('hidden' => '- ' . t('Hidden') . ' -');
}
/**
* {@inheritdoc}
*/
......@@ -142,14 +86,7 @@ protected function getDefaultPlugin($field_type) {
* {@inheritdoc}
*/
protected function getDisplayModes() {
return $this->entityManager->getFormModes($this->entity_type);
}
/**
* {@inheritdoc}
*/
protected function getDisplayType() {
return 'entity_form_display';
return $this->entityManager->getFormModes($this->entity->targetEntityType);
}
/**
......@@ -167,11 +104,11 @@ protected function getTableHeader() {
/**
* {@inheritdoc}
*/
protected function getOverviewRoute($mode) {
$entity_type = $this->entityManager->getDefinition($this->entity_type);
protected function getOverviewUrl($mode) {
$entity_type = $this->entityManager->getDefinition($this->entity->targetEntityType);
$field_entity_type = $entity_type->getBundleEntityType() != 'bundle'? $entity_type->getBundleEntityType() : $entity_type->id();
return Url::fromRoute('field_ui.form_display_overview_form_mode_' . $field_entity_type, [
$this->bundleEntityTypeId => $this->bundle,
return Url::fromRoute('entity.entity_form_display.' . $field_entity_type . '.form_mode', [
$this->bundleEntityTypeId => $this->entity->bundle,
'form_mode_name' => $mode,
]);
}
......@@ -187,7 +124,7 @@ protected function thirdPartySettingsForm(PluginSettingsInterface $plugin, Field
$settings_form[$module] = $this->moduleHandler->invoke($module, 'field_widget_third_party_settings_form', array(
$plugin,
$field_definition,
$this->mode,
$this->entity->mode,
$form,
$form_state,
));
......@@ -202,7 +139,7 @@ protected function alterSettingsSummary(array &$summary, PluginSettingsInterface
$context = array(
'widget' => $plugin,
'field_definition' => $field_definition,
'form_mode' => $this->mode,
'form_mode' => $this->entity->mode,
);
$this->moduleHandler->alter('field_widget_settings_summary', $summary, $context);
}
......
......@@ -2,95 +2,45 @@
/**
* @file
* Contains \Drupal\field_ui\DisplayOverview.
* Contains \Drupal\field_ui\Form\EntityViewDisplayEditForm.
*/
namespace Drupal\field_ui;
namespace Drupal\field_ui\Form;
use Drupal\Component\Plugin\PluginManagerBase;
use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Field\FieldDefinitionInterface;
use Drupal\Core\Entity\Display\EntityDisplayInterface;
use Drupal\Core\Entity\EntityManagerInterface;
use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\Field\FieldTypePluginManager;
use Drupal\Core\Field\FormatterInterface;
use Drupal\Core\Field\PluginSettingsInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Url;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* Field UI display overview form.
* Edit form for the EntityViewDisplay entity type.
*/
class DisplayOverview extends DisplayOverviewBase {
class EntityViewDisplayEditForm extends EntityDisplayFormBase {
/**
* {@inheritdoc}
*/
protected $displayContext = 'view';
/**
* Stores the module manager.
*
* @var \Drupal\Core\Extension\ModuleHandlerInterface
*/
protected $moduleHandler;
/**
* Constructs a new class instance.
*
* @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
* The entity manager.
* @param \Drupal\Core\Field\FieldTypePluginManager $field_type_manager
* The field type manager.
* @param \Drupal\Component\Plugin\PluginManagerBase $plugin_manager
* The widget or formatter plugin manager.
* @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
* The module handler class to use for invoking hooks.
* @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
* The configuration factory.
*/
public function __construct(EntityManagerInterface $entity_manager, FieldTypePluginManager $field_type_manager, PluginManagerBase $plugin_manager, ModuleHandlerInterface $module_handler, ConfigFactoryInterface $config_factory) {
parent::__construct($entity_manager, $field_type_manager, $plugin_manager, $config_factory);
$this->moduleHandler = $module_handler;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container) {
return new static(
$container->get('entity.manager'),
$container->get('plugin.manager.field.field_type'),
$container->get('plugin.manager.field.formatter'),
$container->get('module_handler'),
$container->get('config.factory')
);
}
/**
* {@inheritdoc}
*/
public function getFormId() {
return 'field_ui_display_overview_form';
}
/**
* {@inheritdoc}
*/
public function buildForm(array $form, FormStateInterface $form_state, $entity_type_id = NULL, $bundle = NULL, $view_mode_name = 'default') {
return parent::buildForm($form, $form_state, $entity_type_id, $bundle, $view_mode_name);
$container->get('plugin.manager.field.formatter')
);
}
/**
* {@inheritdoc}
*/
protected function buildFieldRow(FieldDefinitionInterface $field_definition, EntityDisplayInterface $entity_display, array $form, FormStateInterface $form_state) {
$field_row = parent::buildFieldRow($field_definition, $entity_display, $form, $form_state);
protected function buildFieldRow(FieldDefinitionInterface $field_definition, array $form, FormStateInterface $form_state) {
$field_row = parent::buildFieldRow($field_definition, $form, $form_state);
$field_name = $field_definition->getName();
$display_options = $entity_display->getComponent($field_name);
$display_options = $this->entity->getComponent($field_name);
// Insert the label column.
$label = array(
......@@ -108,7 +58,7 @@ protected function buildFieldRow(FieldDefinitionInterface $field_definition, Ent
// Update the (invisible) title of the 'plugin' column.
$field_row['plugin']['#title'] = $this->t('Formatter for @title', array('@title' => $field_definition->getLabel()));
if (!empty($field_row['plugin']['settings_edit_form']) && ($plugin = $entity_display->getRenderer($field_name))) {
if (!empty($field_row['plugin']['settings_edit_form']) && ($plugin = $this->entity->getRenderer($field_name))) {
$plugin_type_info = $plugin->getPluginDefinition();
$field_row['plugin']['settings_edit_form']['label']['#markup'] = $this->t('Format settings:') . ' <span class="plugin-name">' . $plugin_type_info['label'] . '</span>';
}
......@@ -119,8 +69,8 @@ protected function buildFieldRow(FieldDefinitionInterface $field_definition, Ent
/**
* {@inheritdoc}
*/
protected function buildExtraFieldRow($field_id, $extra_field, EntityDisplayInterface $entity_display) {
$extra_field_row = parent::buildExtraFieldRow($field_id, $extra_field, $entity_display);
protected function buildExtraFieldRow($field_id, $extra_field) {
$extra_field_row = parent::buildExtraFieldRow($field_id, $extra_field);
// Insert an empty placeholder for the label column.
$label = array(
......@@ -137,8 +87,8 @@ protected function buildExtraFieldRow($field_id, $extra_field, EntityDisplayInte
/**
* {@inheritdoc}
*/
protected function getEntityDisplay($mode) {
return entity_get_display($this->entity_type, $this->bundle, $mode);
protected function getEntityDisplay($entity_type_id, $bundle, $mode) {
return entity_get_display($entity_type_id, $bundle, $mode);
}
/**
......@@ -150,7 +100,7 @@ protected function getPlugin(FieldDefinitionInterface $field_definition, $config
if ($configuration && $configuration['type'] != 'hidden') {
$plugin = $this->pluginManager->getInstance(array(
'field_definition' => $field_definition,
'view_mode' => $this->mode,
'view_mode' => $this->entity->mode,
'configuration' => $configuration
));
}
......@@ -158,13 +108,6 @@ protected function getPlugin(FieldDefinitionInterface $field_definition, $config
return $plugin;
}
/**
* {@inheritdoc}
*/
protected function getPluginOptions(FieldDefinitionInterface $field_definition) {
return parent::getPluginOptions($field_definition) + array('hidden' => '- ' . $this->t('Hidden') . ' -');
}
/**
* {@inheritdoc}
*/
......@@ -176,14 +119,7 @@ protected function getDefaultPlugin($field_type) {
* {@inheritdoc}
*/
protected function getDisplayModes() {
return $this->entityManager->getViewModes($this->entity_type);
}
/**
* {@inheritdoc}
*/
protected function getDisplayType() {
return 'entity_view_display';
return $this->entityManager->getViewModes($this->entity->targetEntityType);
}
/**
......@@ -202,11 +138,11 @@ protected function getTableHeader() {
/**
* {@inheritdoc}
*/
protected function getOverviewRoute($mode) {
$entity_type = $this->entityManager->getDefinition($this->entity_type);
protected function getOverviewUrl($mode) {
$entity_type = $this->entityManager->getDefinition($this->entity->targetEntityType);
$field_entity_type = $entity_type->getBundleEntityType() != 'bundle'? $entity_type->getBundleEntityType() : $entity_type->id();
return Url::fromRoute('field_ui.display_overview_view_mode_' . $field_entity_type, [
$this->bundleEntityTypeId => $this->bundle,
return Url::fromRoute('entity.entity_view_display.' . $field_entity_type . '.view_mode', [
$this->bundleEntityTypeId => $this->entity->bundle,
'view_mode_name' => $mode,
]);
}
......@@ -237,7 +173,7 @@ protected function thirdPartySettingsForm(PluginSettingsInterface $plugin, Field
$settings_form[$module] = $this->moduleHandler->invoke($module, 'field_formatter_third_party_settings_form', array(
$plugin,
$field_definition,
$this->mode,
$this->entity->mode,
$form,
$form_state,
));
......@@ -252,7 +188,7 @@ protected function alterSettingsSummary(array &$summary, PluginSettingsInterface
$context = array(
'formatter' => $plugin,
'field_definition' => $field_definition,
'view_mode' => $this->mode,
'view_mode' => $this->entity->mode,
);
$this->moduleHandler->alter('field_formatter_settings_summary', $summary, $context);
}
......
......@@ -82,7 +82,7 @@ public function getDerivativeDefinitions($base_plugin_definition) {
// 'Manage form display' tab.
$this->derivatives["form_display_overview_$field_entity_type"] = array(
'route_name' => "entity.{$field_entity_type}.field_ui_form_display",
'route_name' => "entity.entity_form_display.$field_entity_type.default",
'weight' => 2,
'title' => $this->t('Manage form display'),
'base_route' => "entity.$field_entity_type.field_ui_fields",
......@@ -90,7 +90,7 @@ public function getDerivativeDefinitions($base_plugin_definition) {
// 'Manage display' tab.
$this->derivatives["display_overview_$field_entity_type"] = array(
'route_name' => "entity.{$field_entity_type}.field_ui_display",
'route_name' => "entity.entity_view_display.$field_entity_type.default",
'weight' => 3,
'title' => $this->t('Manage display'),
'base_route' => "entity.$field_entity_type.field_ui_fields",
......@@ -119,13 +119,13 @@ public function getDerivativeDefinitions($base_plugin_definition) {
// actually visible for a given bundle.
$this->derivatives['field_form_display_default_' . $field_entity_type] = array(
'title' => 'Default',
'route_name' => "entity.{$field_entity_type}.field_ui_form_display",
'route_name' => "entity.entity_form_display.$field_entity_type.default",
'parent_id' => "field_ui.fields:form_display_overview_$field_entity_type",
'weight' => -1,
);
$this->derivatives['field_display_default_' . $field_entity_type] = array(
'title' => 'Default',
'route_name' => "entity.{$field_entity_type}.field_ui_display",
'route_name' => "entity.entity_view_display.$field_entity_type.default",
'parent_id' => "field_ui.fields:display_overview_$field_entity_type",
'weight' => -1,
);
......@@ -135,7 +135,7 @@ public function getDerivativeDefinitions($base_plugin_definition) {
foreach ($this->entityManager->getFormModes($entity_type_id) as $form_mode => $form_mode_info) {
$this->derivatives['field_form_display_' . $form_mode . '_' . $field_entity_type] = array(
'title' => $form_mode_info['label'],
'route_name' => "field_ui.form_display_overview_form_mode_$field_entity_type",
'route_name' => "entity.entity_form_display.$field_entity_type.form_mode",
'route_parameters' => array(
'form_mode_name' => $form_mode,
),
......@@ -149,7 +149,7 @@ public function getDerivativeDefinitions($base_plugin_definition) {
foreach ($this->entityManager->getViewModes($entity_type_id) as $view_mode => $form_mode_info) {
$this->derivatives['field_display_' . $view_mode . '_' . $field_entity_type] = array(
'title' => $form_mode_info['label'],
'route_name' => "field_ui.display_overview_view_mode_$field_entity_type",
'route_name' => "entity.entity_view_display.$field_entity_type.view_mode",
'route_parameters' => array(
'view_mode_name' => $view_mode,
),
......
......@@ -114,46 +114,48 @@ protected function alterRoutes(RouteCollection $collection) {
$route = new Route(
"$path/form-display",
array(
'_form' => '\Drupal\field_ui\FormDisplayOverview',
'_entity_form' => 'entity_form_display.edit',
'_title' => 'Manage form display',
'form_mode_name' => 'default',
) + $defaults,
array('_field_ui_form_mode_access' => 'administer ' . $entity_type_id . ' form display'),
$options
);
$collection->add("entity.{$bundle_entity_type}.field_ui_form_display", $route);
$collection->add("entity.entity_form_display.$bundle_entity_type.default", $route);
$route = new Route(
"$path/form-display/{form_mode_name}",
array(
'_form' => '\Drupal\field_ui\FormDisplayOverview',
'_entity_form' => 'entity_form_display.edit',
'_title' => 'Manage form display',
) + $defaults,
array('_field_ui_form_mode_access' => 'administer ' . $entity_type_id . ' form display'),
$options
);
$collection->add("field_ui.form_display_overview_form_mode_$bundle_entity_type", $route);
$collection->add("entity.entity_form_display.$bundle_entity_type.form_mode", $route);
$route = new Route(
"$path/display",
array(
'_form' => '\Drupal\field_ui\DisplayOverview',
'_entity_form' => 'entity_view_display.edit',
'_title' => 'Manage display',
'view_mode_name' => 'default',
) + $defaults,
array('_field_ui_view_mode_access' => 'administer ' . $entity_type_id . ' display'),
$options
);
$collection->add("entity.{$bundle_entity_type}.field_ui_display", $route);
$collection->add("entity.entity_view_display.$bundle_entity_type.default", $route);
$route = new Route(
"$path/display/{view_mode_name}",
array(
'_form' => '\Drupal\field_ui\DisplayOverview',
'_entity_form' => 'entity_view_display.edit',
'_title' => 'Manage display',
) + $defaults,
array('_field_ui_view_mode_access' => 'administer ' . $entity_type_id . ' display'),
$options
);
$collection->add("field_ui.display_overview_view_mode_$bundle_entity_type", $route);
$collection->add("entity.entity_view_display.$bundle_entity_type.view_mode", $route);
}
}
}
......
......@@ -65,6 +65,7 @@ public function testFieldUIRoutes() {
$edit = array('display_modes_custom[register]' => TRUE);
$this->drupalPostForm(NULL, $edit, t('Save'));
$this->assertResponse(200);
$this->drupalGet('admin/config/people/accounts/form-display/register');
$this->assertTitle('Manage form display | Drupal');
$this->assertLocalTasks();
......
......@@ -164,6 +164,7 @@ function testFormatterUI() {
// is no longer there.
\Drupal::service('module_installer')->uninstall(array('field_third_party_test'));
$this->drupalGet($manage_display);
$this->assertResponse(200);
$this->assertNoFieldByName('field_test_settings_edit');
}
......
......@@ -7,7 +7,6 @@ dependencies:
module:
- text
id: comment.comment_forum.default
label: null
targetEntityType: comment
bundle: comment_forum
mode: default
......
......@@ -12,7 +12,6 @@ dependencies:
- text
- user
id: node.forum.default
label: null
targetEntityType: node
bundle: forum
mode: default
......
......@@ -12,7 +12,6 @@ dependencies:
- text
- user
id: node.forum.teaser
label: null
targetEntityType: node
bundle: forum
mode: teaser
......
......@@ -6,7 +6,6 @@ dependencies:
module:
- text
id: taxonomy_term.forums.default
label: null
targetEntityType: taxonomy_term
bundle: forums
mode: default
......
......@@ -100,13 +100,13 @@ function node_help($route_name, RouteMatchInterface $route_match) {
case 'node.type_add':
return '<p>' . t('Individual content types can have different fields, behaviors, and permissions assigned to them.') . '</p>';
case "entity.node.field_ui_form_display":
case 'field_ui.form_display_overview_form_mode_node':
case 'entity.entity_form_display.node.default':
case 'entity.entity_form_display.node.form_mode':
$type = $route_match->getParameter('node_type');
return '<p>' . t('Content items can be edited using different form modes. Here, you can define which fields are shown and hidden when %type content is edited in each form mode, and define how the field form widgets are displayed in each form mode.', array('%type' => $type->label())) . '</p>' ;
case 'entity.node.field_ui_display':
case 'field_ui.display_overview_view_mode_node':
case 'entity.entity_view_display.node.default':
case 'entity.entity_view_display.node.view_mode':
$type = $route_match->getParameter('node_type');
return '<p>' . t('Content items can be displayed using different view modes: Teaser, Full content, Print, RSS, etc. <em>Teaser</em> is a short format that is typically used in lists of multiple content items. <em>Full content</em> is typically used when the content is displayed on its own page.') . '</p>' .
'<p>' . t('Here, you can define which fields are shown and hidden when %type content is displayed in each view mode, and define how the fields are displayed in each view mode.', array('%type' => $type->label())) . '</p>';
......
......@@ -8,7 +8,6 @@ dependencies:
- text
- user
id: node.options_install_test.default
label: null
targetEntityType: node
bundle: options_install_test
mode: default
......
......@@ -9,7 +9,6 @@ dependencies:
- text
- user
id: node.options_install_test.teaser
label: null
targetEntityType: node
bundle: options_install_test
mode: teaser
......
......@@ -79,10 +79,10 @@ function user_help($route_name, RouteMatchInterface $route_match) {
case 'entity.user.field_ui_fields':
return '<p>' . t('This form lets administrators add and edit fields for storing user data.') . '</p>';
case 'entity.user.field_ui_form_display':
case 'entity.entity_form_display.user.default':
return '<p>' . t('This form lets administrators configure how form fields should be displayed when editing a user profile.') . '</p>';