Skip to content
Snippets Groups Projects
Commit 7b22d35d authored by Andrei Mateescu's avatar Andrei Mateescu
Browse files

Fix appending the 'in_trash' route param when viewing a deleted entity.

parent df5ee31f
No related branches found
No related tags found
No related merge requests found
Pipeline #450293 passed
...@@ -33,14 +33,12 @@ class TrashRouteProcessor implements OutboundRouteProcessorInterface { ...@@ -33,14 +33,12 @@ class TrashRouteProcessor implements OutboundRouteProcessorInterface {
// displayed on the page (e.g. local tasks) have the proper trash context. // displayed on the page (e.g. local tasks) have the proper trash context.
$request = $this->requestStack->getCurrentRequest(); $request = $this->requestStack->getCurrentRequest();
$current_route = $this->routeMatch->getRouteObject(); $current_route = $this->routeMatch->getRouteObject();
if (!$request || $current_route) { if (!$request || !$current_route) {
return; return;
} }
// Ensure that the code can also be executed when there is no active route if ($request->query->has('in_trash')) {
// match, like on exception responses. $parts = explode('.', $this->routeMatch->getRouteName());
if (($route_name = $this->routeMatch->getRouteName()) && $request->query->has('in_trash')) {
$parts = explode('.', $route_name);
if ($parts[0] === 'entity') { if ($parts[0] === 'entity') {
$entity_type_id = $parts[1]; $entity_type_id = $parts[1];
$entity_id = $this->routeMatch->getRawParameter($entity_type_id); $entity_id = $this->routeMatch->getRawParameter($entity_type_id);
......
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