Commit 275de464 authored by alexpott's avatar alexpott

Issue #2346883 by andypost, amateescu: Standardize field_ui entity route names

parent 180add74
......@@ -7,15 +7,15 @@ field_ui.fields:
class: \Drupal\Core\Menu\LocalTaskDefault
deriver: \Drupal\field_ui\Plugin\Derivative\FieldUiLocalTask
field_ui.entity_view_mode.edit_form:
entity.entity_view_mode.edit_form:
title: 'Edit'
route_name: field_ui.entity_view_mode.edit_form
base_route: field_ui.entity_view_mode.edit_form
route_name: entity.entity_view_mode.edit_form
base_route: entity.entity_view_mode.edit_form
field_ui.entity_form_mode.edit_form:
entity.entity_form_mode.edit_form:
title: 'Edit'
route_name: field_ui.entity_form_mode.edit_form
base_route: field_ui.entity_form_mode.edit_form
route_name: entity.entity_form_mode.edit_form
base_route: entity.entity_form_mode.edit_form
entity.entity_view_mode.collection:
title: List
......
......@@ -291,6 +291,7 @@ function field_ui_entity_type_alter(array &$entity_types) {
$form_mode->set('admin_permission', 'administer display modes');
$form_mode->setLinkTemplate('delete-form', '/admin/structure/display-modes/form/manage/{entity_form_mode}/delete');
$form_mode->setLinkTemplate('edit-form', '/admin/structure/display-modes/form/manage/{entity_form_mode}');
$form_mode->setLinkTemplate('add-form', '/admin/structure/display-modes/form/add/{entity_type_id}');
$form_mode->setLinkTemplate('collection', '/admin/structure/display-modes/form');
$view_mode = $entity_types['entity_view_mode'];
......@@ -301,5 +302,6 @@ function field_ui_entity_type_alter(array &$entity_types) {
$view_mode->set('admin_permission', 'administer display modes');
$view_mode->setLinkTemplate('delete-form', '/admin/structure/display-modes/view/manage/{entity_view_mode}/delete');
$view_mode->setLinkTemplate('edit-form', '/admin/structure/display-modes/view/manage/{entity_view_mode}');
$view_mode->setLinkTemplate('add-form', '/admin/structure/display-modes/view/add/{entity_type_id}');
$view_mode->setLinkTemplate('collection', '/admin/structure/display-modes/view');
}
......@@ -30,7 +30,7 @@ field_ui.entity_view_mode_add:
requirements:
_permission: 'administer display modes'
field_ui.entity_view_mode_add_type:
entity.entity_view_mode.add_form:
path: '/admin/structure/display-modes/view/add/{entity_type_id}'
defaults:
_entity_form: 'entity_view_mode.add'
......@@ -70,7 +70,7 @@ field_ui.entity_form_mode_add:
requirements:
_permission: 'administer display modes'
field_ui.entity_form_mode_add_type:
entity.entity_form_mode.add_form:
path: '/admin/structure/display-modes/form/add/{entity_type_id}'
defaults:
_entity_form: 'entity_form_mode.add'
......
......@@ -27,7 +27,7 @@ public function viewModeTypeSelection() {
if ($entity_type->get('field_ui_base_route') && $entity_type->hasViewBuilderClass()) {
$entity_types[$entity_type_id] = array(
'title' => $entity_type->getLabel(),
'url' => new Url('field_ui.entity_view_mode_add_type', array('entity_type_id' => $entity_type_id)),
'url' => Url::fromRoute('entity.entity_view_mode.add_form', array('entity_type_id' => $entity_type_id)),
'localized_options' => array(),
);
}
......@@ -50,7 +50,7 @@ public function formModeTypeSelection() {
if ($entity_type->get('field_ui_base_route') && $entity_type->hasFormClasses()) {
$entity_types[$entity_type_id] = array(
'title' => $entity_type->getLabel(),
'url' => new Url('field_ui.entity_form_mode_add_type', array('entity_type_id' => $entity_type_id)),
'url' => Url::fromRoute('entity.entity_form_mode.add_form', array('entity_type_id' => $entity_type_id)),
'localized_options' => array(),
);
}
......
......@@ -119,7 +119,7 @@ public function render() {
$table['#rows']['_add_new'][] = array(
'data' => array(
'#type' => 'link',
'#url' => Url::fromRoute($short_type == 'view' ? 'field_ui.entity_view_mode_add_type' : 'field_ui.entity_form_mode_add_type', ['entity_type_id' => $entity_type]),
'#url' => Url::fromRoute($short_type == 'view' ? 'entity.entity_view_mode.add_form' : 'entity.entity_form_mode.add_form', ['entity_type_id' => $entity_type]),
'#title' => t('Add new %label @entity-type', array('%label' => $this->entityTypes[$entity_type]->getLabel(), '@entity-type' => $this->entityType->getLowercaseLabel())),
'#options' => array(
'html' => TRUE,
......
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