From cec21638d098a4526174f0f97eb2e9ad675dcf52 Mon Sep 17 00:00:00 2001
From: catch <6915-catch@users.noreply.drupalcode.org>
Date: Sat, 28 Sep 2024 21:16:05 +0200
Subject: [PATCH] Issue #3477374 by finnsky, longwave, bbrala: Fix "The "tag"
 constructor argument of the "Drupal\\Core\\Template\\TwigNodeTrans" class is
 deprecated and ignored"

---
 core/.deprecation-ignore.txt                           | 1 -
 core/lib/Drupal/Core/Template/TwigNodeTrans.php        | 4 ++--
 core/lib/Drupal/Core/Template/TwigTransTokenParser.php | 2 +-
 3 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/core/.deprecation-ignore.txt b/core/.deprecation-ignore.txt
index 82ebb8206240..4ccb3b3d71b5 100644
--- a/core/.deprecation-ignore.txt
+++ b/core/.deprecation-ignore.txt
@@ -33,5 +33,4 @@
 %Since twig/twig 3.12: Not passing an instance of "TwigFunction" when creating a "add_component_context" function of type "Twig\\Node\\Expression\\FunctionExpression" is deprecated.%
 %Since twig/twig 3.12: Not passing an instance of "TwigFunction" when creating a "render_var" function of type "Twig\\Node\\Expression\\FunctionExpression" is deprecated.%
 %Since twig/twig 3.12: Not passing an instance of "TwigFunction" when creating a "validate_component_props" function of type "Twig\\Node\\Expression\\FunctionExpression" is deprecated.%
-%Since twig/twig 3.12: The "tag" constructor argument of the "Drupal\\Core\\Template\\TwigNodeTrans" class is deprecated and ignored%
 %Since twig/twig 3.12: Twig Filter "spaceless" is deprecated%
diff --git a/core/lib/Drupal/Core/Template/TwigNodeTrans.php b/core/lib/Drupal/Core/Template/TwigNodeTrans.php
index 09f66ea4f1bf..0ac6b93ed5a8 100644
--- a/core/lib/Drupal/Core/Template/TwigNodeTrans.php
+++ b/core/lib/Drupal/Core/Template/TwigNodeTrans.php
@@ -32,7 +32,7 @@ class TwigNodeTrans extends Node {
   /**
    * {@inheritdoc}
    */
-  public function __construct(Node $body, ?Node $plural = NULL, ?AbstractExpression $count = NULL, ?AbstractExpression $options = NULL, $lineno = 0, $tag = NULL) {
+  public function __construct(Node $body, ?Node $plural = NULL, ?AbstractExpression $count = NULL, ?AbstractExpression $options = NULL, $lineno = 0) {
     $nodes['body'] = $body;
     if ($count !== NULL) {
       $nodes['count'] = $count;
@@ -43,7 +43,7 @@ public function __construct(Node $body, ?Node $plural = NULL, ?AbstractExpressio
     if ($options !== NULL) {
       $nodes['options'] = $options;
     }
-    parent::__construct($nodes, [], $lineno, $tag);
+    parent::__construct($nodes, [], $lineno);
   }
 
   /**
diff --git a/core/lib/Drupal/Core/Template/TwigTransTokenParser.php b/core/lib/Drupal/Core/Template/TwigTransTokenParser.php
index 93e4fdcfe3f2..0d764c36f90c 100644
--- a/core/lib/Drupal/Core/Template/TwigTransTokenParser.php
+++ b/core/lib/Drupal/Core/Template/TwigTransTokenParser.php
@@ -56,7 +56,7 @@ public function parse(Token $token) {
 
     $this->checkTransString($body, $lineno);
 
-    $node = new TwigNodeTrans($body, $plural, $count, $options, $lineno, $this->getTag());
+    $node = new TwigNodeTrans($body, $plural, $count, $options, $lineno);
 
     return $node;
   }
-- 
GitLab