- Issue created by @rmontero
We get a weird WSOD when trying to exit out of preview mode. The error says:
Symfony\Component\Routing\Exception\InvalidParameterException: Parameter "node_revision" for route "node.revision_revert_default_confirm" must match "[^/]++" ("" given) to generate a corresponding URL.
We tracked it down to line 249 on
```
$route_info = Url::fromRoute('node.revision_revert_default_confirm', [
'node' => $entity->id(),
'node_revision' => $entity->getRevisionId(),
]);
```
In this edge-case, $entity->getRevisionId() does not return a valid revision id which breaks the doGenerate() function in UrlGenerator.php for the route `node.revision_revert_default_confirm` on `thunder_article.routing.yml`
Create a node (page)
Save it as published. (OK)
Preview (OK)
Exit preview (OK)
Edit it, save it as draft. (OK)
Edit it again, without saving preview. (OK)
Exit Preview (FAILS)
Adding defensive code:
```
$route_info = Url::fromRoute('node.revision_revert_default_confirm', [
'node' => $entity->id(),
'node_revision' => $entity->getRevisionId() ?? 0,
]);
```
Validate the problem and the solution
N/A
N/A
N/A
Active
7.1
Code