Commit e89076aa authored by catch's avatar catch

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
......@@ -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:
......
......@@ -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;
}
}
......@@ -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');
......
......@@ -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'
......
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