Closed fedys closed 8 years ago
Indeed. And the cause is the InjectSubnavigationListener, which throws the following exception while the error template is rendered:
EXCEPTION Could not get a Route Match. route is invalid. in /data/www/clients/client1/web1/YAWIK/module/Settings/src/Settings/Listener/InjectSubNavigationListener.php on line 48
I can try to fix it, ok?
Yes! Just silently exists instead of throwing an exception should be sufficient.
Please push to a new branch, I will then review and merge.
It's a deal
I've pushed 'http-404-fix' branch. I chose another approach because there were multiple places to fix missing RouteMatch during displaying the 404 page. So I create a dummy 'no-route' route on-fly in case of no route error. This way all templates/listeners can work as expected and there is no need to fix non-existing RouteMatch. I've already used this approach in several projects without any side-effects.
Just for reference: The relevant commit is: 4b751ab610ba509d21fd190578d1c2798a35c96f
@fedys If you include somthing like "refs gh-[issueNumber]" in your commits, github will automatically reference the commit in the issue thread.
Nice, I'll include it for the next time.
If you enter for example http://yawik.org/demo/en/non-existent you get HTTP 200 with empty body. Expected result would be HTTP 404 with simple body describing non-existent page.