Skip to content

Issue with the guard tag #4505

@javiereguiluz

Description

@javiereguiluz

I updated a bundle to start using the new guard tag: EasyCorp/EasyAdminBundle#6656

However, instead of the expected guard behavior, in tests you can now see a lot of messages like:

"Did you forget to run "composer require symfony/web-link"?
Unknown function "preload" in "@EasyAdmin/includes/_css_assets.html.twig"."
at UndefinedCallableHandler.php line 105

As @stof explained on Symfony Slack, this only happens when using Twig inside a Symfony application, where this class exists --> https://github.com/symfony/symfony/blob/7.3/src/Symfony/Bridge/Twig/UndefinedCallableHandler.php

@stof proposed to either change the implementation of guard in Twig to skip the undefined callback handler when checking for function existence ... or provide a way for such handlers to opt-in for such bypass.

Thanks!

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