From 805c1d0e5e5e4060209b198cfdc7a69f05eef284 Mon Sep 17 00:00:00 2001 From: Krzysztof Makowski Date: Fri, 28 Jul 2017 08:09:34 +0200 Subject: [PATCH] Fix error empty route name Fix error on requests that cannot access requested _route --- Grid/Grid.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Grid/Grid.php b/Grid/Grid.php index 23530b4c..0b9b3611 100644 --- a/Grid/Grid.php +++ b/Grid/Grid.php @@ -1503,7 +1503,15 @@ public function setRouteUrl($routeUrl) public function getRouteUrl() { if ($this->routeUrl === null) { - $this->routeUrl = $this->router->generate($this->request->get('_route'), $this->getRouteParameters()); + if(!$this->request->get('_route')){ + $this->routeUrl = + $this->router->generate( + $this->request->attributes->get('request')->attributes->get('_route'), + $this->request->attributes->get('request')->attributes->get('_route_params') + ); + } else { + $this->routeUrl = $this->router->generate($this->request->get('_route'), $this->getRouteParameters()); + } } return $this->routeUrl;