Describe your bug or feature request.

This is actually similar to: #3208654: [Drupal 9.x] Use of deprecated class name Twig_Extension

Twig deprecated their old PSR-1 non-namespaced classes with some funky tricks that involve aliasing the old name onto the new one.

If you preload the new class files, then the class_exists() call in vendor/twig/twig/lib/Twig/Extension.php doesn't have to load the class, the class_alias() isn't called and the old class name doesn't exist.

If a bug, provide steps to reproduce it from a clean install.

Proposed resolution

Use the new class names.

Note that this will break compatibility with Drupal 8, do not commit this until you decide to drop support for Drupal 8.9.

Comments

johnchque created an issue. See original summary.

johnchque’s picture

Status: Active » Postponed
StatusFileSize
new826 bytes

This should make it work when needed. :)

johnchque’s picture

Status: Postponed » Needs review
berdir’s picture

Status: Needs review » Needs work

There is at least one more in the price module, search everything for Twig_ class references.

jsacksick’s picture

Status: Needs work » Closed (duplicate)

I initially wanted to create separate tasks for D9 deprecations.. But this would only make sense if the D9 fix doesn't mean we need to drop D8 support.

This isn't the case for most of the test failures/deprecations.

So I now think that it makes sense to fix it all in a single issue, that we can then commit, when it's finally time to drop D8 support, and that is probably going to happen in a 3.x branch.

The task I created yesterday is #3216976: Drop Drupal 8 support.

berdir’s picture

@jsacksick: Ok, fair enough. We will still post an updated patch here as this is a special case that is necessary when using class preloading as mentioned, but feel free to just ignore the issue then.

Don't want to include the other, pretty massive patch that is not passing tests and might conflict with other patches we have.

johnchque’s picture

StatusFileSize
new1.64 KB
new724 bytes

Thanks for the comments. Here updating the deprecated usages from other files as well. :)