Skip to content
Snippets Groups Projects
Verified Commit 7f749579 authored by Dave Long's avatar Dave Long
Browse files

Revert "Issue #3488365 by andypost: Upgrade twig/twig to 3.15.0"

This reverts commit c10262e1.
parent c10262e1
No related branches found
No related tags found
1 merge request!11185Issue #3477324 by andypost, alexpott: Fix usage of str_getcsv() and fgetcsv() for PHP 8.4
Pipeline #351808 passed with warnings
Pipeline: drupal

#351836

    Pipeline: drupal

    #351822

      Pipeline: drupal

      #351816

        +1
        ...@@ -496,7 +496,7 @@ ...@@ -496,7 +496,7 @@
        "dist": { "dist": {
        "type": "path", "type": "path",
        "url": "core", "url": "core",
        "reference": "7369e7a4e89825b0e5c1c8c3a4beaa3a18e5f3ef" "reference": "60fa149dea68d06e2de45c93bf07d1d94b5394e7"
        }, },
        "require": { "require": {
        "asm89/stack-cors": "^2.1", "asm89/stack-cors": "^2.1",
        ...@@ -541,7 +541,7 @@ ...@@ -541,7 +541,7 @@
        "symfony/serializer": "^6.4", "symfony/serializer": "^6.4",
        "symfony/validator": "^6.4", "symfony/validator": "^6.4",
        "symfony/yaml": "^6.4", "symfony/yaml": "^6.4",
        "twig/twig": "^3.15.0" "twig/twig": "^3.14.2"
        }, },
        "conflict": { "conflict": {
        "drush/drush": "<12.4.3" "drush/drush": "<12.4.3"
        ...@@ -4347,16 +4347,16 @@ ...@@ -4347,16 +4347,16 @@
        }, },
        { {
        "name": "twig/twig", "name": "twig/twig",
        "version": "v3.15.0", "version": "v3.14.2",
        "source": { "source": {
        "type": "git", "type": "git",
        "url": "https://github.com/twigphp/Twig.git", "url": "https://github.com/twigphp/Twig.git",
        "reference": "2d5b3964cc21d0188633d7ddce732dc8e874db02" "reference": "0b6f9d8370bb3b7f1ce5313ed8feb0fafd6e399a"
        }, },
        "dist": { "dist": {
        "type": "zip", "type": "zip",
        "url": "https://api.github.com/repos/twigphp/Twig/zipball/2d5b3964cc21d0188633d7ddce732dc8e874db02", "url": "https://api.github.com/repos/twigphp/Twig/zipball/0b6f9d8370bb3b7f1ce5313ed8feb0fafd6e399a",
        "reference": "2d5b3964cc21d0188633d7ddce732dc8e874db02", "reference": "0b6f9d8370bb3b7f1ce5313ed8feb0fafd6e399a",
        "shasum": "" "shasum": ""
        }, },
        "require": { "require": {
        ...@@ -4410,7 +4410,7 @@ ...@@ -4410,7 +4410,7 @@
        ], ],
        "support": { "support": {
        "issues": "https://github.com/twigphp/Twig/issues", "issues": "https://github.com/twigphp/Twig/issues",
        "source": "https://github.com/twigphp/Twig/tree/v3.15.0" "source": "https://github.com/twigphp/Twig/tree/v3.14.2"
        }, },
        "funding": [ "funding": [
        { {
        ...@@ -4422,7 +4422,7 @@ ...@@ -4422,7 +4422,7 @@
        "type": "tidelift" "type": "tidelift"
        } }
        ], ],
        "time": "2024-11-17T15:59:19+00:00" "time": "2024-11-07T12:36:22+00:00"
        } }
        ], ],
        "packages-dev": [ "packages-dev": [
        ......
        ...@@ -61,6 +61,6 @@ ...@@ -61,6 +61,6 @@
        "symfony/var-dumper": "~v6.4.15", "symfony/var-dumper": "~v6.4.15",
        "symfony/var-exporter": "~v6.4.13", "symfony/var-exporter": "~v6.4.13",
        "symfony/yaml": "~v6.4.13", "symfony/yaml": "~v6.4.13",
        "twig/twig": "~v3.15.0" "twig/twig": "~v3.14.2"
        } }
        } }
        ...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
        "symfony/process": "^6.4", "symfony/process": "^6.4",
        "symfony/polyfill-iconv": "^1.26", "symfony/polyfill-iconv": "^1.26",
        "symfony/yaml": "^6.4", "symfony/yaml": "^6.4",
        "twig/twig": "^3.15.0", "twig/twig": "^3.14.2",
        "doctrine/annotations": "^1.14", "doctrine/annotations": "^1.14",
        "guzzlehttp/guzzle": "^7.5", "guzzlehttp/guzzle": "^7.5",
        "guzzlehttp/psr7": "^2.4.5", "guzzlehttp/psr7": "^2.4.5",
        ......
        ...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
        use Drupal\Core\Render\Component\Exception\InvalidComponentException; use Drupal\Core\Render\Component\Exception\InvalidComponentException;
        use Drupal\Core\Theme\ComponentPluginManager; use Drupal\Core\Theme\ComponentPluginManager;
        use Twig\Environment; use Twig\Environment;
        use Twig\Node\Nodes;
        use Twig\TwigFunction; use Twig\TwigFunction;
        use Twig\Node\Expression\ConstantExpression; use Twig\Node\Expression\ConstantExpression;
        use Twig\Node\Expression\FunctionExpression; use Twig\Node\Expression\FunctionExpression;
        ...@@ -58,24 +57,24 @@ public function leaveNode(Node $node, Environment $env): ?Node { ...@@ -58,24 +57,24 @@ public function leaveNode(Node $node, Environment $env): ?Node {
        } }
        $print_nodes[] = new PrintNode(new FunctionExpression( $print_nodes[] = new PrintNode(new FunctionExpression(
        new TwigFunction('attach_library', [$env->getExtension(TwigExtension::class), 'attachLibrary']), new TwigFunction('attach_library', [$env->getExtension(TwigExtension::class), 'attachLibrary']),
        new Nodes([new ConstantExpression($component->getLibraryName(), $line)]), new Node([new ConstantExpression($component->getLibraryName(), $line)]),
        $line $line
        ), $line); ), $line);
        $print_nodes[] = new PrintNode(new FunctionExpression( $print_nodes[] = new PrintNode(new FunctionExpression(
        new TwigFunction('add_component_context', [$env->getExtension(ComponentsTwigExtension::class), 'addAdditionalContext'], ['needs_context' => TRUE]), new TwigFunction('add_component_context', [$env->getExtension(ComponentsTwigExtension::class), 'addAdditionalContext'], ['needs_context' => TRUE]),
        new Nodes([new ConstantExpression($component_id, $line)]), new Node([new ConstantExpression($component_id, $line)]),
        $line $line
        ), $line); ), $line);
        $print_nodes[] = new PrintNode(new FunctionExpression( $print_nodes[] = new PrintNode(new FunctionExpression(
        new TwigFunction('validate_component_props', [$env->getExtension(ComponentsTwigExtension::class), 'validateProps'], ['needs_context' => TRUE]), new TwigFunction('validate_component_props', [$env->getExtension(ComponentsTwigExtension::class), 'validateProps'], ['needs_context' => TRUE]),
        new Nodes([new ConstantExpression($component_id, $line)]), new Node([new ConstantExpression($component_id, $line)]),
        $line $line
        ), $line); ), $line);
        // Append the print nodes to the display_start node. // Append the print nodes to the display_start node.
        $node->setNode( $node->setNode(
        'display_start', 'display_start',
        new Nodes([ new Node([
        $node->getNode('display_start'), $node->getNode('display_start'),
        ...$print_nodes, ...$print_nodes,
        ]), ]),
        ...@@ -85,7 +84,7 @@ public function leaveNode(Node $node, Environment $env): ?Node { ...@@ -85,7 +84,7 @@ public function leaveNode(Node $node, Environment $env): ?Node {
        // Append the closing comment to the display_end node. // Append the closing comment to the display_end node.
        $node->setNode( $node->setNode(
        'display_end', 'display_end',
        new Nodes([ new Node([
        new PrintNode(new ConstantExpression(sprintf('<!-- %s Component end: %s -->', $emoji, $component_id), $line), $line), new PrintNode(new ConstantExpression(sprintf('<!-- %s Component end: %s -->', $emoji, $component_id), $line), $line),
        $node->getNode('display_end'), $node->getNode('display_end'),
        ]) ])
        ......
        ...@@ -13,9 +13,7 @@ ...@@ -13,9 +13,7 @@
        use Twig\Node\Expression\GetAttrExpression; use Twig\Node\Expression\GetAttrExpression;
        use Twig\Node\Expression\NameExpression; use Twig\Node\Expression\NameExpression;
        use Twig\Node\Expression\TempNameExpression; use Twig\Node\Expression\TempNameExpression;
        use Twig\Node\Expression\Variable\ContextVariable;
        use Twig\Node\Node; use Twig\Node\Node;
        use Twig\Node\Nodes;
        use Twig\Node\PrintNode; use Twig\Node\PrintNode;
        /** /**
        ...@@ -180,7 +178,7 @@ protected function compileString(Node $body) { ...@@ -180,7 +178,7 @@ protected function compileString(Node $body) {
        if (!is_null($args)) { if (!is_null($args)) {
        $argName = $args->getAttribute('name'); $argName = $args->getAttribute('name');
        } }
        $expr = new ContextVariable($argName, $n->getTemplateLine()); $expr = new NameExpression($argName, $n->getTemplateLine());
        } }
        $placeholder = sprintf('%s%s', $argPrefix, $argName); $placeholder = sprintf('%s%s', $argPrefix, $argName);
        $text .= $placeholder; $text .= $placeholder;
        ...@@ -200,7 +198,7 @@ protected function compileString(Node $body) { ...@@ -200,7 +198,7 @@ protected function compileString(Node $body) {
        } }
        return [ return [
        new Nodes([new ConstantExpression(trim($text), $body->getTemplateLine())]), new Node([new ConstantExpression(trim($text), $body->getTemplateLine())]),
        $tokens, $tokens,
        ]; ];
        } }
        ......
        ...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
        namespace Drupal\Core\Template; namespace Drupal\Core\Template;
        use Twig\Environment; use Twig\Environment;
        use Twig\Node\Nodes;
        use Twig\TwigFunction; use Twig\TwigFunction;
        use Twig\Node\Expression\FilterExpression; use Twig\Node\Expression\FilterExpression;
        use Twig\Node\Expression\FunctionExpression; use Twig\Node\Expression\FunctionExpression;
        ...@@ -51,7 +50,7 @@ public function leaveNode(Node $node, Environment $env): ?Node { ...@@ -51,7 +50,7 @@ public function leaveNode(Node $node, Environment $env): ?Node {
        return new $class( return new $class(
        new FunctionExpression( new FunctionExpression(
        new TwigFunction('render_var', [$env->getExtension(TwigExtension::class), 'renderVar']), new TwigFunction('render_var', [$env->getExtension(TwigExtension::class), 'renderVar']),
        new Nodes([$node->getNode('expr')]), new Node([$node->getNode('expr')]),
        $line $line
        ), ),
        $line $line
        ......
        ...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
        use Twig\Node\Expression\NameExpression; use Twig\Node\Expression\NameExpression;
        use Twig\Node\ModuleNode; use Twig\Node\ModuleNode;
        use Twig\Node\Node; use Twig\Node\Node;
        use Twig\Node\Nodes;
        use Twig\NodeVisitor\NodeVisitorInterface; use Twig\NodeVisitor\NodeVisitorInterface;
        /** /**
        ...@@ -60,7 +59,7 @@ public function leaveNode(Node $node, Environment $env): ?Node { ...@@ -60,7 +59,7 @@ public function leaveNode(Node $node, Environment $env): ?Node {
        // At the end of the template, check the used variables are not deprecated. // At the end of the template, check the used variables are not deprecated.
        if ($node instanceof ModuleNode) { if ($node instanceof ModuleNode) {
        if (!empty($this->usedNames)) { if (!empty($this->usedNames)) {
        $checkNode = new Nodes([new TwigNodeCheckDeprecations($this->usedNames), $node->getNode('display_end')]); $checkNode = new Node([new TwigNodeCheckDeprecations($this->usedNames), $node->getNode('display_end')]);
        $node->setNode('display_end', $checkNode); $node->setNode('display_end', $checkNode);
        } }
        } }
        ......
        ...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
        use Twig\Environment; use Twig\Environment;
        use Twig\Node\ModuleNode; use Twig\Node\ModuleNode;
        use Twig\Node\Node; use Twig\Node\Node;
        use Twig\Node\Nodes;
        use Twig\NodeVisitor\NodeVisitorInterface; use Twig\NodeVisitor\NodeVisitorInterface;
        /** /**
        ...@@ -45,11 +44,11 @@ public function enterNode(Node $node, Environment $env): Node { ...@@ -45,11 +44,11 @@ public function enterNode(Node $node, Environment $env): Node {
        */ */
        public function leaveNode(Node $node, Environment $env): ?Node { public function leaveNode(Node $node, Environment $env): ?Node {
        if ($node instanceof ModuleNode) { if ($node instanceof ModuleNode) {
        $node->setNode('display_start', new Nodes([ $node->setNode('display_start', new Node([
        new EnterProfileNode($this->extensionName, $this->varName), new EnterProfileNode($this->extensionName, $this->varName),
        $node->getNode('display_start'), $node->getNode('display_start'),
        ])); ]));
        $node->setNode('display_end', new Nodes([ $node->setNode('display_end', new Node([
        new LeaveProfileNode($this->varName), new LeaveProfileNode($this->varName),
        $node->getNode('display_end'), $node->getNode('display_end'),
        ])); ]));
        ......
        0% Loading or .
        You are about to add 0 people to the discussion. Proceed with caution.
        Finish editing this message first!
        Please register or to comment