Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Twig 3.12 #15624

Merged
merged 2 commits into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG-WIP.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@
### System
- MySQL mutex locks and PHP session names are now namespaced using the application ID combined with the environment name. ([#15313](https://github.com/craftcms/cms/issues/15313))
- `x-craft-preview` and `x-craft-live-preview` params are now hashed, and `craft\web\Request::getIsPreview()` will only return `true` if the param validates. ([#15605](https://github.com/craftcms/cms/discussions/15605))
- Updated Twig to 3.12. ([#15568](https://github.com/craftcms/cms/discussions/15568))
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"symfony/var-dumper": "^5.0|^6.0",
"symfony/yaml": "^5.2.3",
"theiconic/name-parser": "^1.2",
"twig/twig": "~3.8.0",
"twig/twig": "~3.12.0",
"voku/stringy": "^6.4.0",
"webonyx/graphql-php": "~14.11.5",
"yiisoft/yii2": "~2.0.51.0",
Expand Down
72 changes: 35 additions & 37 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/helpers/Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use craft\web\View;
use Twig\Environment;
use Twig\Error\RuntimeError;
use Twig\Extension\CoreExtension;
use Twig\Extension\SandboxExtension;
use Twig\Markup;
use Twig\Source;
Expand All @@ -25,7 +26,6 @@
use yii\base\UnknownPropertyException;
use yii\db\Query;
use yii\db\QueryInterface;
use function twig_get_attribute;

/**
* Class Template
Expand Down Expand Up @@ -145,7 +145,7 @@ public static function attribute(
}

try {
return twig_get_attribute(
return CoreExtension::getAttribute(
$env,
$source,
$object,
Expand Down
3 changes: 2 additions & 1 deletion src/web/twig/nodes/GetAttrNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
use Twig\Template;

/**
* GetAttrNode is an alternative to [[\Twig\Node\Expression\GetAttrExpression]], which sends attribute calls to [[TemplateHelper::attribute()]] rather than twig_get_attribute().
* GetAttrNode is an alternative to [[\Twig\Node\Expression\GetAttrExpression]], which sends attribute calls to
* [[TemplateHelper::attribute()]] rather than CoreExtension::getAttribute().
*
* @author Pixel & Tonic, Inc. <[email protected]>
* @since 3.0.0
Expand Down
2 changes: 1 addition & 1 deletion src/web/twig/nodes/NavNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function __construct(AssignNameExpression $keyTarget, AssignNameExpressio
$this->navItemNode = new NavItem_Node($valueTarget, $indent, $outdent, $lowerBody, $lineno, $tag);
$body = new Node([$this->navItemNode, $upperBody]);

parent::__construct($keyTarget, $valueTarget, $seq, null, $body, null, $lineno, $tag);
parent::__construct($keyTarget, $valueTarget, $seq, null, $body, null, $lineno);
}

/**
Expand Down
Loading