Skip to content
Snippets Groups Projects
Commit e89076aa authored by catch's avatar catch
Browse files

Revert "Issue #2688668 by Berdir, bojanz: Register the new entity revision...

Revert "Issue #2688668 by Berdir, bojanz: Register the new entity revision param enhancer/converter as services"

This reverts commit fff38959.
parent fff38959
No related branches found
No related tags found
No related merge requests found
...@@ -909,11 +909,6 @@ services: ...@@ -909,11 +909,6 @@ services:
tags: tags:
- { name: paramconverter } - { name: paramconverter }
arguments: ['@entity.manager'] arguments: ['@entity.manager']
paramconverter.entity_revision:
class: Drupal\Core\ParamConverter\EntityRevisionParamConverter
tags:
- { name: paramconverter }
arguments: ['@entity_type.manager']
paramconverter.configentity_admin: paramconverter.configentity_admin:
class: Drupal\Core\ParamConverter\AdminPathConfigEntityConverter class: Drupal\Core\ParamConverter\AdminPathConfigEntityConverter
tags: tags:
...@@ -968,10 +963,6 @@ services: ...@@ -968,10 +963,6 @@ services:
class: Drupal\Core\Entity\Enhancer\EntityRouteEnhancer class: Drupal\Core\Entity\Enhancer\EntityRouteEnhancer
tags: tags:
- { name: route_enhancer, priority: 20 } - { name: route_enhancer, priority: 20 }
route_enhancer.entity_revision:
class: Drupal\Core\Routing\Enhancer\EntityRevisionRouteEnhancer
tags:
- { name: route_enhancer }
route_special_attributes_subscriber: route_special_attributes_subscriber:
class: Drupal\Core\EventSubscriber\SpecialAttributesRouteSubscriber class: Drupal\Core\EventSubscriber\SpecialAttributesRouteSubscriber
tags: tags:
......
...@@ -104,25 +104,8 @@ public function view(EntityInterface $_entity, $view_mode = 'full') { ...@@ -104,25 +104,8 @@ public function view(EntityInterface $_entity, $view_mode = 'full') {
$page['#entity_type'] = $_entity->getEntityTypeId(); $page['#entity_type'] = $_entity->getEntityTypeId();
$page['#' . $page['#entity_type']] = $_entity; $page['#' . $page['#entity_type']] = $_entity;
return $page;
}
/** 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);
} }
} }
...@@ -68,17 +68,6 @@ function testEntityViewController() { ...@@ -68,17 +68,6 @@ function testEntityViewController() {
$this->assertRaw('full'); $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 // As entity_test IDs must be integers, make sure requests for non-integer
// IDs return a page not found error. // IDs return a page not found error.
$this->drupalGet('entity_test/invalid'); $this->drupalGet('entity_test/invalid');
......
...@@ -58,13 +58,7 @@ entity.entity_test.collection: ...@@ -58,13 +58,7 @@ entity.entity_test.collection:
entity.entity_test_rev.revision: entity.entity_test_rev.revision:
path: '/entity_test_rev/{entity_test_rev}/revision/{entity_test_rev_revision}/view' path: '/entity_test_rev/{entity_test_rev}/revision/{entity_test_rev_revision}/view'
defaults: defaults:
_controller: '\Drupal\Core\Entity\Controller\EntityViewController::viewRevision' _entity_view: 'entity_test_rev'
options:
parameters:
entity_test_rev:
type: entity:entity_test_rev
entity_test_rev_revision:
type: entity_revision:entity_test_rev
requirements: requirements:
_access: 'TRUE' _access: 'TRUE'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment