Skip to content

guard failing in 3.18 #4526

@tacman

Description

@tacman

I use this to make sure dumps don't happen in production. symfony/debug-bundle is not installed on production, symfony/twig-bundle is. Everything's updated to the latest code

    {% guard function dump %}
        {{ dump(article) }}
    {% endguard %}

When I run it in production, it fails, I see this message in the logs:

me":"2025-01-02T12:36:52.973795+00:00","extra":{}}
[PHP        ] {"message":"Authenticator does not support the request.","context":{"firewall_name":"main","authenticator":"Symfony\\Component\\Security\\Http\\Authenticator\\FormLoginAuthenticator"},"level":100,"level_name":"DEBUG","channel":"security","datetime":"2025-01-02T12:36:52.973798+00:00","extra":{}}
[PHP        ] {"message":"Uncaught PHP Exception Twig\\Error\\SyntaxError: \"Did you forget to run \"composer require symfony/twig-bundle\"? Unknown function \"dump\" in \"app/article.html.twig\".\" at UndefinedCallableHandler.php line 112","context":{"exception":{"class":"Twig\\Error\\SyntaxError","message":"Did you forget to run \"composer require symfony/twig-bundle\"? Unknown function \"dump\" in \"app/article.html.twig\".","code":0,"file":"/home/tac/g/sites/magazine/vendor/symfony/twig-bridge/UndefinedCallableHandler.php:112"}},"level":500,"level_name":"CRITICAL","channel":"request","datetime":"2025-01-02T12:36:53.615001+00:00","extra":{}}

Of course, symfony/twig-bundle is installed. And this works fine in dev. And I think this used to work before the latest 7.2.2.

composer outdated
Activating installation...
Color legend:
- patch or minor release available - update recommended
- major release available - update possible

Direct dependencies required in composer.json:
doctrine/dbal                      3.9.3  4.2.1  Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management.
phpunit/phpunit                    9.6.22 11.5.2 The PHP Unit Testing framework.

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