Commit fb557917 authored by webchick's avatar webchick

Issue #2314889 by andypost, Temoor: Standardize entity_test entity route names.

parent ee52df94
......@@ -430,6 +430,8 @@ public function testsNonIntegerIdEntities() {
$this->drupalGet('entity_test_string_id/structure/entity_test/fields');
// Ensure field isn't shown for string IDs.
$this->assertNoOption('edit-fields-add-new-field-type', 'comment');
// Ensure a core field type shown.
$this->assertOption('edit-fields-add-new-field-type', 'boolean');
// Create a bundle for entity_test_no_id.
entity_test_create_bundle('entity_test', 'Entity Test', 'entity_test_no_id');
......@@ -440,6 +442,8 @@ public function testsNonIntegerIdEntities() {
$this->drupalGet('entity_test_no_id/structure/entity_test/fields');
// Ensure field isn't shown for empty IDs.
$this->assertNoOption('edit-fields-add-new-field-type', 'comment');
// Ensure a core field type shown.
$this->assertOption('edit-fields-add-new-field-type', 'boolean');
}
}
entity_test.render:
entity.entity_test.canonical:
path: '/entity_test/{entity_test}'
defaults:
_entity_view: 'entity_test.full'
......@@ -6,35 +6,35 @@ entity_test.render:
requirements:
_access: 'TRUE'
entity_test.delete_entity_test:
entity.entity_test.delete_form:
path: '/entity_test/delete/entity_test/{entity_test}'
defaults:
_entity_form: entity_test.delete
requirements:
_access: 'TRUE'
entity_test.delete_entity_test_mul:
entity.entity_test_mul.delete_form:
path: '/entity_test/delete/entity_test_mul/{entity_test_mul}'
defaults:
_entity_form: entity_test_mul.delete
requirements:
_access: 'TRUE'
entity_test.delete_entity_test_mulrev:
entity.entity_test_mulrev.delete_form:
path: '/entity_test/delete/entity_test_mulrev/{entity_test_mulrev}'
defaults:
_entity_form: entity_test_mulrev.delete
requirements:
_access: 'TRUE'
entity_test.delete_entity_test_rev:
entity.entity_test_rev.delete_form:
path: '/entity_test/delete/entity_test_rev/{entity_test_rev}'
defaults:
_entity_form: entity_test_rev.delete
requirements:
_access: 'TRUE'
entity_test.render_options:
entity.entity_test.render_options:
path: '/entity_test_converter/{foo}'
options:
parameters:
......@@ -45,14 +45,14 @@ entity_test.render_options:
requirements:
_access: 'TRUE'
entity_test.render_no_view_mode:
entity.entity_test.render_no_view_mode:
path: '/entity_test_no_view_mode/{entity_test}'
defaults:
_entity_view: 'entity_test'
requirements:
_access: 'TRUE'
entity_test.list_referencing_entities:
entity.entity_test.list_referencing_entities:
path: '/entity_test/list/{entity_reference_field_name}/{referenced_entity_type}/{referenced_entity_id}'
defaults:
_content: '\Drupal\entity_test\Controller\EntityTestController::listReferencingEntities'
......
......@@ -41,11 +41,11 @@
* "label" = "name"
* },
* links = {
* "canonical" = "entity_test.render",
* "edit-form" = "entity_test.edit_entity_test",
* "delete-form" = "entity_test.delete_entity_test",
* "canonical" = "entity.entity_test.canonical",
* "edit-form" = "entity.entity_test.edit_form",
* "delete-form" = "entity.entity_test.delete_form",
* },
* field_ui_base_route = "entity_test.admin_entity_test",
* field_ui_base_route = "entity.entity_test.admin_form",
* )
*/
class EntityTest extends ContentEntityBase implements EntityOwnerInterface {
......
......@@ -31,9 +31,9 @@
* "bundle" = "type"
* },
* links = {
* "edit-form" = "entity_test.edit_entity_test",
* "edit-form" = "entity.entity_test_base_field_display.edit_form",
* },
* field_ui_base_route = "entity_test.admin_entity_test",
* field_ui_base_route = "entity.entity_test_base_field_display.admin_form",
* )
*/
class EntityTestBaseFieldDisplay extends EntityTest {
......
......@@ -37,11 +37,11 @@
* "label" = "name"
* },
* links = {
* "canonical" = "entity_test.edit_entity_test_mul",
* "edit-form" = "entity_test.edit_entity_test_mul",
* "delete-form" = "entity_test.delete_entity_test_mul",
* "canonical" = "entity.entity_test_mul.edit_form",
* "edit-form" = "entity.entity_test_mul.edit_form",
* "delete-form" = "entity.entity_test_mul.delete_form",
* },
* field_ui_base_route = "entity_test.admin_entity_test_mul",
* field_ui_base_route = "entity.entity_test_mul.admin_form",
* )
*/
class EntityTestMul extends EntityTest {
......
......@@ -38,9 +38,9 @@
* "bundle" = "type"
* },
* links = {
* "canonical" = "entity_test.edit_entity_test_mulrev",
* "delete-form" = "entity_test.delete_entity_test_mulrev",
* "edit-form" = "entity_test.edit_entity_test_mulrev"
* "canonical" = "entity.entity_test_mulrev.edit_form",
* "delete-form" = "entity.entity_test_mulrev.delete_form",
* "edit-form" = "entity.entity_test_mulrev.edit_form"
* }
* )
*/
......
......@@ -20,7 +20,7 @@
* entity_keys = {
* "bundle" = "type",
* },
* field_ui_base_route = "entity_test.admin_entity_test_no_id",
* field_ui_base_route = "entity.entity_test_no_id.admin_form",
* )
*/
class EntityTestNoId extends EntityTest {
......
......@@ -36,9 +36,9 @@
* "label" = "name",
* },
* links = {
* "canonical" = "entity_test.edit_entity_test_rev",
* "delete-form" = "entity_test.delete_entity_test_rev",
* "edit-form" = "entity_test.edit_entity_test_rev"
* "canonical" = "entity.entity_test_rev.edit_form",
* "delete-form" = "entity.entity_test_rev.delete_form",
* "edit-form" = "entity.entity_test_rev.edit_form"
* }
* )
*/
......
......@@ -31,10 +31,10 @@
* "bundle" = "type"
* },
* links = {
* "canonical" = "entity_test.render",
* "edit-form" = "entity_test.edit_entity_test_string_id",
* "canonical" = "entity.entity_test.canonical",
* "edit-form" = "entity.entity_test_string_id.edit_form",
* },
* field_ui_base_route = "entity_test.admin_entity_test_string_id",
* field_ui_base_route = "entity.entity_test_string_id.admin_form",
* )
*/
class EntityTestStringId extends EntityTest {
......
......@@ -95,7 +95,7 @@ public function save(array $form, FormStateInterface $form_state) {
if ($entity->id()) {
$entity_type = $entity->getEntityTypeId();
$form_state->setRedirect(
"entity_test.edit_$entity_type",
"entity.$entity_type.edit_form",
array($entity_type => $entity->id())
);
}
......
......@@ -23,8 +23,8 @@ public function getDerivativeDefinitions($base_plugin_definition) {
foreach($types as $entity_type) {
$this->derivatives[$entity_type] = array();
$this->derivatives[$entity_type]['base_route'] = "entity_test.edit_$entity_type";
$this->derivatives[$entity_type]['route_name'] = "entity_test.edit_$entity_type";
$this->derivatives[$entity_type]['base_route'] = "entity.$entity_type.edit_form";
$this->derivatives[$entity_type]['route_name'] = "entity.$entity_type.edit_form";
$this->derivatives[$entity_type]['title'] = 'Edit';
}
......
......@@ -27,13 +27,13 @@ public function routes() {
$routes = array();
foreach ($types as $entity_type) {
$routes["entity_test.add_$entity_type"] = new Route(
$routes["entity.$entity_type.add_form"] = new Route(
"$entity_type/add",
array('_content' => '\Drupal\entity_test\Controller\EntityTestController::testAdd', 'entity_type' => $entity_type),
array('_permission' => 'administer entity_test content')
);
$routes["entity_test.edit_$entity_type"] = new Route(
$routes["entity.$entity_type.edit_form"] = new Route(
"$entity_type/manage/{" . $entity_type . '}',
array('_content' => '\Drupal\entity_test\Controller\EntityTestController::testEdit', '_entity_type' => $entity_type),
array('_permission' => 'administer entity_test content'),
......@@ -42,7 +42,7 @@ public function routes() {
))
);
$routes["entity_test.admin_$entity_type"] = new Route(
$routes["entity.$entity_type.admin_form"] = new Route(
"$entity_type/structure/{bundle}",
array('_content' => '\Drupal\entity_test\Controller\EntityTestController::testAdmin'),
array('_permission' => 'administer entity_test content')
......
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