You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
@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!
The text was updated successfully, but these errors were encountered:
We cannot bypass undefined handlers as they might register functions/filters.
The problem here comes from Symfony implementation of such undefined handlers as Symfony throws an exception.
But Twig docs are very clear on this topic:
If the callable is not able to return a valid function/filter/tag, it must return false.
So, the only workaround I can see in Twig would be to catch all exceptions and ignore them.
I updated a bundle to start using the new
guard
tag: EasyCorp/EasyAdminBundle#6656However, instead of the expected
guard
behavior, in tests you can now see a lot of messages like: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!
The text was updated successfully, but these errors were encountered: