From 2ad180e387cbd74d30a25dab8e721ce10eb86a1e Mon Sep 17 00:00:00 2001 From: Bojan Zivanovic <bojanz@gmail.com> Date: Mon, 28 Mar 2016 18:56:57 +0200 Subject: [PATCH] Final changes for 8.1 rebase. --- composer.json | 5 +++- entity.info.yml | 2 ++ src/Controller/RevisionController.php | 36 --------------------------- src/Routing/RevisionRouteProvider.php | 2 +- 4 files changed, 7 insertions(+), 38 deletions(-) delete mode 100644 src/Controller/RevisionController.php diff --git a/composer.json b/composer.json index f340fe9..b41c15a 100644 --- a/composer.json +++ b/composer.json @@ -3,5 +3,8 @@ "type": "drupal-module", "description": "Provides expanded entity APIs, which will be moved to Drupal core one day.", "homepage": "http://drupal.org/project/entity", - "license": "GPL-2.0+" + "license": "GPL-2.0+", + "require": { + "drupal/core": "~8.1" + } } diff --git a/entity.info.yml b/entity.info.yml index cf09971..0b032e6 100644 --- a/entity.info.yml +++ b/entity.info.yml @@ -2,3 +2,5 @@ name: Entity description: Provides expanded entity APIs, which will be moved to Drupal core one day. type: module core: 8.x +dependencies: + - system (>=8.1.0) diff --git a/src/Controller/RevisionController.php b/src/Controller/RevisionController.php deleted file mode 100644 index b85ee83..0000000 --- a/src/Controller/RevisionController.php +++ /dev/null @@ -1,36 +0,0 @@ -<?php - -/** - * @file - * Contains \Drupal\entity\Controller\RevisionController. - */ - -namespace Drupal\entity\Controller; - -use Drupal\Core\Entity\Controller\EntityViewController; -use Drupal\Core\Entity\EntityInterface; - -/** - * Provides some controllers related with entity revisions. - */ -class RevisionController extends EntityViewController { - - /** - * 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 view(EntityInterface $_entity_revision, $view_mode = 'full') { - return parent::view($_entity_revision, $view_mode); - } - -} diff --git a/src/Routing/RevisionRouteProvider.php b/src/Routing/RevisionRouteProvider.php index 33d2766..7e3afe2 100644 --- a/src/Routing/RevisionRouteProvider.php +++ b/src/Routing/RevisionRouteProvider.php @@ -51,7 +51,7 @@ class RevisionRouteProvider implements EntityRouteProviderInterface { $entity_type_id = $entity_type->id(); $route = new Route($entity_type->getLinkTemplate('revision')); $route->addDefaults([ - '_controller' => '\Drupal\entity\Controller\RevisionController::view', + '_controller' => '\Drupal\Core\Entity\Controller\EntityViewController::viewRevision', '_title_callback' => '\Drupal\Core\Entity\Controller\EntityController::title', ]); $route->addRequirements([ -- GitLab