diff --git a/src/Symfony/Component/Routing/RouteCollection.php b/src/Symfony/Component/Routing/RouteCollection.php index ffdf57f478..b60b7f3d2c 100644 --- a/src/Symfony/Component/Routing/RouteCollection.php +++ b/src/Symfony/Component/Routing/RouteCollection.php @@ -163,7 +163,10 @@ class RouteCollection implements \IteratorAggregate, \Countable public function remove($name) { // just for BC - $root = $this->getRoot(); + $root = $this; + while ($root->parent) { + $root = $root->parent; + } foreach ((array) $name as $n) { unset($root->routes[$n]);