$this->
messenger() ->
addStatus($this->
t('Revision from %revision-date of @type %title has been deleted.',
[ '%revision-date' =>
$this->dateFormatter->
format($this->revision->
getRevisionCreationTime()),
'@type' =>
$node_type,
'%title' =>
$this->revision->
label(),
]));
// Set redirect to the revisions history page.
$route_name = 'entity.node.version_history';
$parameters =
['node' =>
$this->revision->
id()];
// If no revisions found, or the user does not have access to the revisions
// page, then redirect to the canonical node page instead.
if (!
$this->accessManager->
checkNamedRoute($route_name,
$parameters) ||
count($this->nodeStorage->
revisionIds($this->revision
)) === 1
) { $route_name = 'entity.node.canonical';
} $form_state->
setRedirect($route_name,
$parameters);
}}