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

Add conflict with twig 3.10.0 #69

Merged
merged 1 commit into from
May 11, 2024
Merged

Add conflict with twig 3.10.0 #69

merged 1 commit into from
May 11, 2024

Conversation

zoglo
Copy link
Member

@zoglo zoglo commented May 11, 2024

The recently released twig version adds new deprecations:

twigphp/Twig@v3.9.3...v3.10.0

You must call "setEnvironment()" before calling "Twig\Extension\EscaperExtension::setEscaper()".

@fritzmg
Copy link
Contributor

fritzmg commented May 11, 2024

To be clear, this is the error that currently occurs during cache:warmup

11:37:54 CRITICAL  [console] Error thrown while running command "cache:warmup --env=prod --no-ansi". Message: "You must call "setEnvironment()" before calling "Twig\Extension\EscaperExtension::setEscaper()"." ["exception" => LogicException { …},"command" => "cache:warmup --env=prod --no-ansi","message" => "You must call "setEnvironment()" before calling "Twig\Extension\EscaperExtension::setEscaper()"."]

In EscaperExtension.php line 127:
                                                                               
  You must call "setEnvironment()" before calling "Twig\Extension\EscaperExte  
  nsion::setEscaper()".

@zoglo
Copy link
Member Author

zoglo commented May 11, 2024

This is causing it and would need a fix wherever the EscaperExtension is used

https://github.com/twigphp/Twig/blob/bfc3b7b19be1d3411d5b9ada4091ec7eecd3dd8a/CHANGELOG#L13-L16

The following methods from Twig\\Extension\\EscaperExtension are deprecated:

  • setEscaper()
  • getEscapers()
  • setSafeClasses,
  • addSafeClasses()

Use the same methods on the Twig\\Runtime\\EscaperRuntime class instead.

@fritzmg
Copy link
Contributor

fritzmg commented May 11, 2024

But deprecations do not cause critical errors, there must be another issue.

@fritzmg
Copy link
Contributor

fritzmg commented May 11, 2024

twigphp/Twig#4082

@ausi ausi changed the title Add conflict to twig 3.10.0 Add conflict with twig 3.10.0 May 11, 2024
@ausi ausi merged commit 19495b2 into contao:main May 11, 2024
@ausi
Copy link
Member

ausi commented May 11, 2024

Do we need to fix this in Contao? Or do we just have to wait until twigphp/Twig#4082 is fixed?

@m-vo
Copy link
Member

m-vo commented May 11, 2024

There is a PR that aims at fixing the BC break. I did not check whether it fixes our issue as well, though. 🤞

See twigphp/Twig#4083

@zoglo zoglo deleted the patch-1 branch May 11, 2024 17:58
@fritzmg
Copy link
Contributor

fritzmg commented May 12, 2024

3.10.1 was released already.

@fritzmg
Copy link
Contributor

fritzmg commented May 12, 2024

Unfortunately there is a different issue now: twigphp/Twig#4087

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants