10000 Template override for 404 errors · Issue #5206 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
Template override for 404 errors #5206
Closed
@aerialls

Description

@aerialls

I'm using the master branch for my Symfony2 project and i've found an issue with templates override.
I have a custom template located to app/Resources/TwigBundle/views/Exception/error404.html.twig for 404 errors.

{% extends "AndroBundle::frontend.html.twig" %}

{% block title %}Oops! This page is not longer available{% endblock %}

{% block content %}
    <h2>Oops! This page is not longer available</h2>

    <p>This page may have moved or is no longer available.</p>
{% endblock %}

The parent template is my main template and exists. But I've an issue with 404 errors in prod env only. On debug mode, everything works well, i have the exception page with the callstack... But in production I see a blank page with 500 error code.
My apache error log is the following:

PHP Fatal error:  Uncaught exception 'Symfony\\Component\\Routing\\Exception\\ResourceNotFoundException' in /home/web/androirc-test.com/releases/20120807100731/app/cache/prod/appprodUrlMatcher.php:7129
Stack trace:
#0 /home/web/androirc-test.com/releases/20120807100731/app/cache/prod/classes.php(9501): appprodUrlMatcher->match('/changelog')
#1 /home/web/androirc-test.com/releases/20120807100731/app/cache/prod/classes.php(5144): JMS\\I18nRoutingBundle\\Router\\I18nRouter->match('/changelog')
#2 [internal function]: Symfony\\Component\\HttpKernel\\EventListener\\RouterListener->onKernelRequest(Object(Symfony\\Component\\HttpKernel\\Event\\GetResponseEvent))
#3 /home/web/androirc-test.com/releases/20120807100731/app/cache/prod/classes.php(4879): call_user_func(Array, Object(Symfony\\Component\\HttpKernel\\Event\\GetResponseEvent))
#4 /home/web/androirc-test.com/releases/20120807100731/app/cache/prod/classes.php(4793): Symfony\\Component\\EventDispatcher\\EventDispatcher->doDispatch(Array, 'kernel.request', Object(Symfony\\Component\\HttpKernel\\Event\\Get in /home/web/androirc-test.com/releases/20120807100731/app/cache/prod/classes.php on line 5158

After some research, I've located the problem to the twig template. If i edit my template and replace it with an empty page, it's working. Once I add an extends block, the issue occurs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0