Loading core/modules/node/src/Controller/NodeController.php +2 −1 Original line number Diff line number Diff line Loading @@ -6,6 +6,7 @@ use Drupal\Core\Controller\ControllerBase; use Drupal\Core\Datetime\DateFormatterInterface; use Drupal\Core\DependencyInjection\ContainerInjectionInterface; use Drupal\Core\Entity\Controller\EntityViewController; use Drupal\Core\Entity\EntityRepositoryInterface; use Drupal\Core\Link; use Drupal\Core\Render\RendererInterface; Loading Loading @@ -110,7 +111,7 @@ public function addPage() { * An array suitable for \Drupal\Core\Render\RendererInterface::render(). */ public function revisionShow(NodeInterface $node_revision) { $node_view_controller = new NodeViewController($this->entityTypeManager(), $this->renderer, $this->currentUser(), $this->entityRepository); $node_view_controller = new EntityViewController($this->entityTypeManager(), $this->renderer); $page = $node_view_controller->view($node_revision); unset($page['nodes'][$node_revision->id()]['#cache']); return $page; Loading core/modules/node/src/Controller/NodeViewController.php +6 −0 Original line number Diff line number Diff line Loading @@ -12,6 +12,11 @@ /** * Defines a controller to render a single node. * * @deprecated in drupal:11.4.0 and is removed from drupal:13.0.0. Use * \Drupal\Core\Entity\Controller\EntityViewController instead. * * @see https://www.drupal.org/node/3589636 */ class NodeViewController extends EntityViewController { Loading Loading @@ -42,6 +47,7 @@ class NodeViewController extends EntityViewController { * The entity repository. */ public function __construct(EntityTypeManagerInterface $entity_type_manager, RendererInterface $renderer, AccountInterface $current_user, EntityRepositoryInterface $entity_repository) { @trigger_error(__CLASS__ . ' is deprecated in drupal:11.4.0 and is removed from drupal:13.0.0. Use \Drupal\Core\Entity\Controller\EntityViewController instead. See https://www.drupal.org/node/3589636', E_USER_DEPRECATED); parent::__construct($entity_type_manager, $renderer); $this->currentUser = $current_user; $this->entityRepository = $entity_repository; Loading core/modules/node/src/Entity/NodeRouteProvider.php +0 −10 Original line number Diff line number Diff line Loading @@ -5,7 +5,6 @@ use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\Entity\Routing\DefaultHtmlRouteProvider; use Drupal\node\Controller\NodeController; use Drupal\node\Controller\NodeViewController; /** * Provides routes for nodes. Loading Loading @@ -53,15 +52,6 @@ protected function getAddFormRoute(EntityTypeInterface $entity_type) { } } /** * {@inheritdoc} */ protected function getCanonicalRoute(EntityTypeInterface $entity_type) { if ($route = parent::getCanonicalRoute($entity_type)) { return $route->setDefault('_controller', NodeViewController::class . '::view'); } } /** * {@inheritdoc} */ Loading Loading
core/modules/node/src/Controller/NodeController.php +2 −1 Original line number Diff line number Diff line Loading @@ -6,6 +6,7 @@ use Drupal\Core\Controller\ControllerBase; use Drupal\Core\Datetime\DateFormatterInterface; use Drupal\Core\DependencyInjection\ContainerInjectionInterface; use Drupal\Core\Entity\Controller\EntityViewController; use Drupal\Core\Entity\EntityRepositoryInterface; use Drupal\Core\Link; use Drupal\Core\Render\RendererInterface; Loading Loading @@ -110,7 +111,7 @@ public function addPage() { * An array suitable for \Drupal\Core\Render\RendererInterface::render(). */ public function revisionShow(NodeInterface $node_revision) { $node_view_controller = new NodeViewController($this->entityTypeManager(), $this->renderer, $this->currentUser(), $this->entityRepository); $node_view_controller = new EntityViewController($this->entityTypeManager(), $this->renderer); $page = $node_view_controller->view($node_revision); unset($page['nodes'][$node_revision->id()]['#cache']); return $page; Loading
core/modules/node/src/Controller/NodeViewController.php +6 −0 Original line number Diff line number Diff line Loading @@ -12,6 +12,11 @@ /** * Defines a controller to render a single node. * * @deprecated in drupal:11.4.0 and is removed from drupal:13.0.0. Use * \Drupal\Core\Entity\Controller\EntityViewController instead. * * @see https://www.drupal.org/node/3589636 */ class NodeViewController extends EntityViewController { Loading Loading @@ -42,6 +47,7 @@ class NodeViewController extends EntityViewController { * The entity repository. */ public function __construct(EntityTypeManagerInterface $entity_type_manager, RendererInterface $renderer, AccountInterface $current_user, EntityRepositoryInterface $entity_repository) { @trigger_error(__CLASS__ . ' is deprecated in drupal:11.4.0 and is removed from drupal:13.0.0. Use \Drupal\Core\Entity\Controller\EntityViewController instead. See https://www.drupal.org/node/3589636', E_USER_DEPRECATED); parent::__construct($entity_type_manager, $renderer); $this->currentUser = $current_user; $this->entityRepository = $entity_repository; Loading
core/modules/node/src/Entity/NodeRouteProvider.php +0 −10 Original line number Diff line number Diff line Loading @@ -5,7 +5,6 @@ use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\Entity\Routing\DefaultHtmlRouteProvider; use Drupal\node\Controller\NodeController; use Drupal\node\Controller\NodeViewController; /** * Provides routes for nodes. Loading Loading @@ -53,15 +52,6 @@ protected function getAddFormRoute(EntityTypeInterface $entity_type) { } } /** * {@inheritdoc} */ protected function getCanonicalRoute(EntityTypeInterface $entity_type) { if ($route = parent::getCanonicalRoute($entity_type)) { return $route->setDefault('_controller', NodeViewController::class . '::view'); } } /** * {@inheritdoc} */ Loading