Closed KevinSleegers closed 7 years ago
For the time being I did also post this on StackOverflow, hoping someone on there could provide me with an answer to this issue. (http://stackoverflow.com/questions/37316474/symfony-kunstmaan-cms-503-error-page-instead-of-404)
Hi Kevin, can you give me some more details? Do you see errors/criticals in your logfile? Or in the php error log? What do you mean with the redirect?
Hi jockri,
This is the code I'm using for the ExceptionController.php (https://gist.github.com/KevinSleegers/8e01f3870df9a30f0cf0d75f053ec7be).
I get the following error: Fatal error: Maximum function nesting level of '256' reached, aborting! in /var/www/html/secretwebsite/app/cache/dev/classes.php on line 5332
This error only occurs when I set the internalname of a page to 'error', if I don't do that I get the default 404 / Error page of Kunstmaan.
Within my log I see the following: [2016-05-21 15:48:46] request.ERROR: Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\NotFoundHttpException: "No page found for slug 404-pagina" at /var/www/html/secretwebsite/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php line 251 {"exception":"[object] (Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException(code: 0): No page found for slug 404-pagina at /var/www/html/secretwebsite/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php:251)"} {"file":"/var/www/html/secretwebsite/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php","line":91,"class":"Symfony\\Component\\HttpKernel\\EventListener\\ExceptionListener","function":"logException"}
I did dump the contenst of both $errorNodeTranslation and $errorNodeTranslation->getUrl() and they both are defined. I have no idea how the slug can be undefined. I also did try errorNodeTranslation->getSlug() which returned the same as getUrl().
Also, the slug that gets returned from $errorNodeTranslation->getUrl() is definitely a page. When I append it to app_dev.php/ or app.php/ I go to the page without any problem.
Cleaning up old issues
Hi,
I'm using Kunstmaan 2.8.4-DEV for a project, and for some reason the 404 page / redirect is not working. Instead, the page keeps loading and eventually returns a 503 error.
Strange thing is that the exact same code, for the ExceptionController, is working fine in other projects that use older versions of Kunstmaan.
I've searched within the documentation for changes in more recent versions of Kunstmaan, but have not been able to find anything.