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

Error base_template_class is deprecated #4755

Closed
sebastian-lenz opened this issue Aug 14, 2019 · 5 comments
Closed

Error base_template_class is deprecated #4755

sebastian-lenz opened this issue Aug 14, 2019 · 5 comments

Comments

@sebastian-lenz
Copy link
Contributor

Description

When running Craft CMS the following php error is triggered:

PHP Deprecated: The "base_template_class" option on Twig\Environment is 
deprecated since Twig 2.7.0. 
in vendor/twig/twig/src/Environment.php on line 121

The option base_template_class is set in the View class here. This is related to #4704.

This is a documented behavior of twig, please refer to their docs:
https://twig.symfony.com/doc/2.x/deprecated.html#environment

Steps to reproduce

  1. Open any page in Craft, the admin login page for example.
  2. Check the error log of the web server or the console output of XDebug.

Additional info

  • Craft version: Craft Solo 3.2.10
  • PHP version: 7.3.8
  • Database driver & version: MySQL 5.7.27
@brandonkelly
Copy link
Member

Great.

@sebastian-lenz
Copy link
Contributor Author

Sorry for that one, I'm just the messenger.

@brandonkelly
Copy link
Member

We primarily extend the base class to hook template rendering into Yii profiling for the Debug toolbar. There’s no good alternative way to do that currently, as far as I can tell.

Posted twigphp/Twig#3129 asking for a new way to hook into template rendering, so we’ll see what they come back with.

brandonkelly added a commit that referenced this issue Aug 20, 2019
@brandonkelly
Copy link
Member

This has been fixed for Craft 3.3!

@nikolowry
Copy link

@brandonkelly we use suppressTemplateErrors in production environments -- what's the recommended approach now that suppressTemplateErrors is deprecated?

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

No branches or pull requests

3 participants