Kunstmaan / KunstmaanBundlesCMS

An advanced yet user-friendly content management system, based on the full stack Symfony framework combined with a whole host of community bundles. It provides a full featured, multi-language CMS system with an innovative page and form assembling process, versioning, workflow, translation and media managers and much more.
https://kunstmaancms.be
MIT License
402 stars 186 forks source link

Kunstmaan 503 error page instead of 404 #1163

Closed KevinSleegers closed 7 years ago

KevinSleegers commented 8 years ago

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.

KevinSleegers commented 8 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)

jockri commented 8 years ago

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?

KevinSleegers commented 8 years ago

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().

KevinSleegers commented 8 years ago

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.

jockri commented 7 years ago

Cleaning up old issues