From e89076aae2a9086b30bd457859b40bec0a839e28 Mon Sep 17 00:00:00 2001 From: Nathaniel Catchpole <catch@35733.no-reply.drupal.org> Date: Tue, 29 Mar 2016 09:01:10 +0900 Subject: [PATCH] Revert "Issue #2688668 by Berdir, bojanz: Register the new entity revision param enhancer/converter as services" This reverts commit fff38959a1d5e567f1c39fc6504280826167234f. --- core/core.services.yml | 9 --------- .../Controller/EntityViewController.php | 19 +------------------ .../Tests/Entity/EntityViewControllerTest.php | 11 ----------- .../entity_test/entity_test.routing.yml | 8 +------- 4 files changed, 2 insertions(+), 45 deletions(-) diff --git a/core/core.services.yml b/core/core.services.yml index 5e63508f6c4b..7c1e473ac49f 100644 --- a/core/core.services.yml +++ b/core/core.services.yml @@ -909,11 +909,6 @@ services: tags: - { name: paramconverter } arguments: ['@entity.manager'] - paramconverter.entity_revision: - class: Drupal\Core\ParamConverter\EntityRevisionParamConverter - tags: - - { name: paramconverter } - arguments: ['@entity_type.manager'] paramconverter.configentity_admin: class: Drupal\Core\ParamConverter\AdminPathConfigEntityConverter tags: @@ -968,10 +963,6 @@ services: class: Drupal\Core\Entity\Enhancer\EntityRouteEnhancer tags: - { name: route_enhancer, priority: 20 } - route_enhancer.entity_revision: - class: Drupal\Core\Routing\Enhancer\EntityRevisionRouteEnhancer - tags: - - { name: route_enhancer } route_special_attributes_subscriber: class: Drupal\Core\EventSubscriber\SpecialAttributesRouteSubscriber tags: diff --git a/core/lib/Drupal/Core/Entity/Controller/EntityViewController.php b/core/lib/Drupal/Core/Entity/Controller/EntityViewController.php index 435aa5793638..d416e3aadb25 100644 --- a/core/lib/Drupal/Core/Entity/Controller/EntityViewController.php +++ b/core/lib/Drupal/Core/Entity/Controller/EntityViewController.php @@ -104,25 +104,8 @@ public function view(EntityInterface $_entity, $view_mode = 'full') { $page['#entity_type'] = $_entity->getEntityTypeId(); $page['#' . $page['#entity_type']] = $_entity; - return $page; - } - /** - * Provides a page to render a single entity revision. - * - * @param \Drupal\Core\Entity\EntityInterface $_entity_revision - * The Entity to be rendered. Note this variable is named $_entity_revision - * rather than $entity to prevent collisions with other named placeholders - * in the route. - * @param string $view_mode - * (optional) The view mode that should be used to display the entity. - * Defaults to 'full'. - * - * @return array - * A render array. - */ - public function viewRevision(EntityInterface $_entity_revision, $view_mode = 'full') { - return $this->view($_entity_revision, $view_mode); + return $page; } } diff --git a/core/modules/system/src/Tests/Entity/EntityViewControllerTest.php b/core/modules/system/src/Tests/Entity/EntityViewControllerTest.php index 882c61d6791f..81ffb6790238 100644 --- a/core/modules/system/src/Tests/Entity/EntityViewControllerTest.php +++ b/core/modules/system/src/Tests/Entity/EntityViewControllerTest.php @@ -68,17 +68,6 @@ function testEntityViewController() { $this->assertRaw('full'); } - // Test viewing a revisionable entity. - $entity_test_rev = $this->createTestEntity('entity_test_rev'); - $entity_test_rev->save(); - $entity_test_rev->name->value = 'rev 2'; - $entity_test_rev->setNewRevision(TRUE); - $entity_test_rev->isDefaultRevision(TRUE); - $entity_test_rev->save(); - $this->drupalGet('entity_test_rev/' . $entity_test_rev->id() . '/revision/' . $entity_test_rev->revision_id->value . '/view'); - $this->assertRaw($entity_test_rev->label()); - $this->assertRaw($get_label_markup($entity_test_rev->label())); - // As entity_test IDs must be integers, make sure requests for non-integer // IDs return a page not found error. $this->drupalGet('entity_test/invalid'); diff --git a/core/modules/system/tests/modules/entity_test/entity_test.routing.yml b/core/modules/system/tests/modules/entity_test/entity_test.routing.yml index e4353c877170..542a14ebbcd4 100644 --- a/core/modules/system/tests/modules/entity_test/entity_test.routing.yml +++ b/core/modules/system/tests/modules/entity_test/entity_test.routing.yml @@ -58,13 +58,7 @@ entity.entity_test.collection: entity.entity_test_rev.revision: path: '/entity_test_rev/{entity_test_rev}/revision/{entity_test_rev_revision}/view' defaults: - _controller: '\Drupal\Core\Entity\Controller\EntityViewController::viewRevision' - options: - parameters: - entity_test_rev: - type: entity:entity_test_rev - entity_test_rev_revision: - type: entity_revision:entity_test_rev + _entity_view: 'entity_test_rev' requirements: _access: 'TRUE' -- GitLab