Skip to content

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

@GromNaN

Description

@GromNaN

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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy