Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[TwigBridge] function twig_test_empty is deprecated in Twig 3.9 #52987

Copy link
Copy link
Closed
@GromNaN

Description

@GromNaN
Issue body actions

Symfony version(s) affected

5.4.31, 6.4.0, 7.0.0, 7.1

Description

The twig_* global functions are deprecated in Twig 3.9 twigphp/Twig#3883, and removed in Twig 4.0 twigphp/Twig#3937

The function twig_test_empty is used in Symfony\Bridge\Twig\Node\SearchAndRenderBlockNode:

if (!twig_test_empty($label->getAttribute('value'))) {

$compiler->raw('(twig_test_empty($_label_ = ');

How to reproduce

composer create-project symfony/demo
composer require "twig/twig: 3.x-dev"

Go to https://localhost:8000/fr/admin/post/1/edit

Deprecation message:

Since twig/twig 3.9.0: Using the internal "twig_test_empty" function is deprecated.

Possible Solution

Duplicate the function as a static method in SearchAndRenderBlockNode.

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.