Skip to content
Snippets Groups Projects
Commit c50b3d34 authored by Erik Stielstra's avatar Erik Stielstra
Browse files

Issue #3281927 by Sutharsan, nsciacca: Error on node revision route due to...

Issue #3281927 by Sutharsan, nsciacca: Error on node revision route due to core type upcasting change
parent abcf1aed
No related branches found
No related tags found
No related merge requests found
......@@ -458,7 +458,12 @@ class FieldBlock extends BlockBase implements ContainerFactoryPluginInterface {
elseif ($entity_type === 'node') {
if ($route_name == 'entity.node.revision') {
$entity_revision = $this->routeMatch->getParameter('node_revision');
$entity = $this->entityTypeManager->getStorage('node')->loadRevision($entity_revision);
if (is_numeric($entity_revision)) {
$entity = $this->entityTypeManager->getStorage('node')->loadRevision($entity_revision);
}
else {
$entity = $entity_revision;
}
}
elseif ($route_name == 'entity.node.preview' && $this->routeMatch->getParameter('view_mode_id') === 'full') {
$entity = $this->routeMatch->getParameter('node_preview');
......
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