Skip to content
Snippets Groups Projects
Commit 82fed915 authored by catch's avatar catch
Browse files

Issue #3039408 by vijaycs85, WidgetsBurritos, alexpott, phenaproxima, Joseph...

Issue #3039408 by vijaycs85, WidgetsBurritos, alexpott, phenaproxima, Joseph Zhao, tstoeckler, kfritsche, mikelutz, fabpot: Updating twig/twig to v1.38.0 or v1.38.1 causes fatal error
parent 30654bd4
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -2021,7 +2021,7 @@
},
{
"name": "Gert de Pagter",
"email": "BackEndTea@gmail.com"
"email": "backendtea@gmail.com"
}
],
"description": "Symfony polyfill for ctype functions",
......@@ -2691,31 +2691,31 @@
},
{
"name": "twig/twig",
"version": "v1.35.4",
"version": "v1.38.2",
"source": {
"type": "git",
"url": "https://github.com/twigphp/Twig.git",
"reference": "7e081e98378a1e78c29cc9eba4aefa5d78a05d2a"
"reference": "874adbd9222f928f6998732b25b01b41dff15b0c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/twigphp/Twig/zipball/7e081e98378a1e78c29cc9eba4aefa5d78a05d2a",
"reference": "7e081e98378a1e78c29cc9eba4aefa5d78a05d2a",
"url": "https://api.github.com/repos/twigphp/Twig/zipball/874adbd9222f928f6998732b25b01b41dff15b0c",
"reference": "874adbd9222f928f6998732b25b01b41dff15b0c",
"shasum": ""
},
"require": {
"php": ">=5.3.3",
"php": ">=5.4.0",
"symfony/polyfill-ctype": "^1.8"
},
"require-dev": {
"psr/container": "^1.0",
"symfony/debug": "^2.7",
"symfony/phpunit-bridge": "^3.3"
"symfony/phpunit-bridge": "^3.4.19|^4.1.8"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.35-dev"
"dev-master": "1.38-dev"
}
},
"autoload": {
......@@ -2753,7 +2753,7 @@
"keywords": [
"templating"
],
"time": "2018-07-13T07:12:17+00:00"
"time": "2019-03-12T18:45:24+00:00"
},
{
"name": "typo3/phar-stream-wrapper",
......@@ -4166,6 +4166,7 @@
"mock",
"xunit"
],
"abandoned": true,
"time": "2015-10-02T06:51:40+00:00"
},
{
......
......@@ -32,7 +32,7 @@
"symfony/polyfill-iconv": "^1.0",
"symfony/yaml": "~3.4.5",
"typo3/phar-stream-wrapper": "^2.0.1",
"twig/twig": "^1.35.0",
"twig/twig": "^1.38.2",
"doctrine/common": "^2.5",
"doctrine/annotations": "^1.2",
"guzzlehttp/guzzle": "^6.2.1",
......
......@@ -2,6 +2,8 @@
namespace Drupal\Core\Template;
use Twig\Node\CheckToStringNode;
/**
* A class that defines the Twig 'trans' tag for Drupal.
*
......@@ -116,6 +118,9 @@ protected function compileString(\Twig_Node $body) {
$n = $n->getNode('node');
}
if ($n instanceof CheckToStringNode) {
$n = $n->getNode('expr');
}
$args = $n;
// Support TwigExtension->renderVar() function in chain.
......@@ -137,6 +142,9 @@ protected function compileString(\Twig_Node $body) {
}
$args = $args->getNode('node');
}
if ($args instanceof CheckToStringNode) {
$args = $args->getNode('expr');
}
if ($args instanceof \Twig_Node_Expression_GetAttr) {
$argName = [];
// Reuse the incoming expression.
......
......@@ -2,6 +2,9 @@
namespace Drupal\twig_extension_test\TwigExtension;
use Twig\TwigFilter;
use Twig\TwigFunction;
/**
* A test Twig extension that adds a custom function and a custom filter.
*/
......@@ -21,7 +24,7 @@ class TestExtension extends \Twig_Extension {
*/
public function getFunctions() {
return [
new \Twig_SimpleFunction('testfunc', [$this, 'testFunction']),
'testfunc' => new TwigFunction('testfunc', ['Drupal\twig_extension_test\TwigExtension\TestExtension', 'testFunction']),
];
}
......@@ -39,7 +42,7 @@ public function getFunctions() {
*/
public function getFilters() {
return [
new \Twig_SimpleFilter('testfilter', [$this, 'testFilter']),
'testfilter' => new TwigFilter('testfilter', ['Drupal\twig_extension_test\TwigExtension\TestExtension', 'testFilter']),
];
}
......
......@@ -3,6 +3,7 @@
namespace Drupal\Tests\system\Functional\Theme;
use Drupal\Tests\BrowserTestBase;
use Twig\TemplateWrapper;
/**
* Tests Twig registry loader.
......@@ -33,7 +34,7 @@ protected function setUp() {
* Checks to see if a value is a Twig template.
*/
public function assertTwigTemplate($value, $message = '', $group = 'Other') {
$this->assertTrue($value instanceof \Twig_Template, $message, $group);
$this->assertTrue($value instanceof TemplateWrapper, $message, $group);
}
/**
......
......@@ -3,6 +3,7 @@
namespace Drupal\Tests\system\Kernel\Theme;
use Drupal\KernelTests\KernelTestBase;
use Twig\TemplateWrapper;
/**
* Tests Twig namespaces.
......@@ -33,7 +34,7 @@ protected function setUp() {
* Checks to see if a value is a twig template.
*/
public function assertTwigTemplate($value, $message = '', $group = 'Other') {
$this->assertTrue($value instanceof \Twig_Template, $message, $group);
$this->assertTrue($value instanceof TemplateWrapper, $message, $group);
}
/**
......
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