Updated: Comment #N

Problem/Motivation

There has been some improvements that would help autoescape compiling about 20% faster. And a bunch of bug fixes for auto-escape and UTF strings.

Change Log Diff:

* 1.15.0 (2013-12-06)

 * made ignoreStrictCheck in Template::getAttribute() works with __call() methods throwing BadMethodCallException
 * added min and max functions
 * added the round filter
 * fixed a bug that prevented the optimizers to be enabled/disabled selectively
 * fixed first and last filters for UTF-8 strings
 * added a source function to include the content of a template without rendering it
 * fixed the C extension sandbox behavior when get or set is prepend to method name

* 1.14.2 (2013-10-30)

 * fixed error filename/line when an error occurs in an included file
 * allowed operators that contain whitespaces to have more than one whitespace
 * allowed tests to be made of 1 or 2 words (like "same as" or "divisible by")

* 1.14.1 (2013-10-15)

 * made it possible to use named operators as variables
 * fixed the possibility to have a variable named 'matches'
 * added support for PHP 5.5 DateTimeInterface

* 1.14.0 (2013-10-03)

 * fixed usage of the html_attr escaping strategy to avoid double-escaping with the html strategy
 * added new operators: ends with, starts with, and matches
 * fixed some compatibility issues with HHVM
 * added a way to add custom escaping strategies
 * fixed the C extension compilation on Windows
 * fixed the batch filter when using a fill argument with an exact match of elements to batch
 * fixed the filesystem loader cache when a template name exists in several namespaces
 * fixed template_from_string when the template includes or extends other ones
 * fixed a crash of the C extension on an edge case

* 1.13.2 (2013-08-03)

 * fixed the error line number for an error occurs in and embedded template
 * fixed crashes of the C extension on some edge cases

* 1.13.1 (2013-06-06)

 * added the possibility to ignore the filesystem constructor argument in Twig_Loader_Filesystem
 * fixed Twig_Loader_Chain::exists() for a loader which implements Twig_ExistsLoaderInterface
 * adjusted backtrace call to reduce memory usage when an error occurs
 * added support for object instances as the second argument of the constant test
 * fixed the include function when used in an assignment

* 1.13.0 (2013-05-10)

 * fixed getting a numeric-like item on a variable ('09' for instance)
 * fixed getting a boolean or float key on an array, so it is consistent with PHP's array access:
   `{{ array[false] }}` behaves the same as `echo $array[false];` (equals `$array[0]`)
 * made the escape filter 20% faster for happy path (escaping string for html with UTF-8)
 * changed ☃ to § in tests
 * enforced usage of named arguments after positional ones

Proposed resolution

Update Twig to 1.15.* from 1.12.*

Remaining tasks

N/A

User interface changes

N/A

API changes

N/A

Follow-up from #1825952: Turn on twig autoescape by default.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

joelpittet’s picture

Title: Update Twig » Upgrade Twig to 1.15.* from 1.12.*
FileSize
284.65 KB

Here's the composer upgraded patch.

joelpittet’s picture

Status: Needs work » Needs review
joelpittet’s picture

Assigned: Unassigned » joelpittet
Category: Bug report » Task
siwinski’s picture

This would help with the packaging of Drupal 8 for Fedora/EPEL as Fedora requires all bundled libraries to be unbundled and Fedora/EPEL already have Twig version 1.15.0. Note that I do not plan on pulling Drupal 8 into Fedora until it hits beta, but I'm glad this Twig update is in the works :)

chx’s picture

Apparently every composer update now pulls in this psr4 stuff #2161397: Update to Symfony 2.4.1 does too so that's not a concern. The patch is green, the changes are just good and speed up stuff which we desperately need so it's definitely a go.

Such patch. Much speed. Very update. Wow.

chx’s picture

Status: Needs review » Reviewed & tested by the community
webchick’s picture

Priority: Normal » Major

Escalating to major.

webchick’s picture

Same question as #2173719-5: Remove the fork of doctrine/common, though. Is it possible to update just Twig and not also Composer? I doubt it but just checking since these and all other library update patches are going to conflict with each other otherwise.

dawehner’s picture

Same question as #2173719-5: Remove the fork of doctrine/common, though. Is it possible to update just Twig and not also Composer? I doubt it but just checking since these and all other library update patches are going to conflict with each other otherwise.

You get the new composer stuff if you update your composer installation (which is basically done automatically as it asks you after some time). If we decide to require people to go with an old composer version we fork kind of composer and get into a niche again.

This change is NOT about using PSR-4, just about replacing the internals of the autoloader we use. I would really like to not FORCE all drupal people to basically not run with the recent composer version.

webchick’s picture

That makes sense.

Is it possible then to do what we've done in previous patches then, and update the Composer autoloader in its own separate patch/commit? I'm happy to commit it as soon as it's ready. I'll be around all night.

tim.plunkett’s picture

joelpittet’s picture

Assigned: joelpittet » Unassigned
FileSize
268.5 KB

Same same without composer.

joelpittet’s picture

12: 2172235-upgrade-twig-12.patch queued for re-testing.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed to 8.x. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.