symfony-cmf/MenuBundle — pull request #185 by EmmanuelVella (2014-04-15 15:32:52+00:00)
Title: Handle RouteNotFoundException

| Q | A
| ------------- | ---
| Bug fix? | [yes]
| New feature? | [no]
| BC breaks? | [no]
| Deprecations? | [no]
| Tests pass? | [yes]
| Fixed tickets | N/A
| License | MIT

When a menu node references a route, this route may not exist anymore, leading to a ``RouteNotFoundException``.

This PR handle this by logging the exception and by returning null or an empty menu node (depending on the configuration).

If there is no error, the ``$options['route']`` is unset and ``$options['uri']`` is set.

@dbu I prefered to directly try/catch the route generation to be able to return an empty item.