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

Adapt Smarty templates to less forgiving PHP8 environment #6783

Open
asmecher opened this issue Feb 22, 2021 · 0 comments
Open

Adapt Smarty templates to less forgiving PHP8 environment #6783

asmecher opened this issue Feb 22, 2021 · 0 comments
Labels
Housekeeping:1:Todo Any dependency management or refactor that would be nice to have some day.

Comments

@asmecher
Copy link
Member

asmecher commented Feb 22, 2021

PHP8 is pickier about code in ways that affect Smarty templates. In order to enable PHP8 support, it was necessary to extend Smarty's error suppression so that new warnings didn't cause problems:

3c88c04

See the Smarty discussion here:

smarty-php/smarty#605

It appears that the best long-term solution will be to adapt our Smarty templates so that they do not use undefined variables. This will be a big task as Smarty was previously forgiving about this and we frequently made use of it.

In order to do this, on a machine running PHP8...

  • Revert the change to PKPTemplateManager that suppresses warnings
  • Work through the warnings that result.

(Edit: We will need to think through the implications for third parties of making Smarty significantly stricter. One possible solution will be to introduce a "strict" mode, so our codebase can be coded as tightly as possible, but have it permit some flexibility when that strict mode is disabled.)

@asmecher asmecher added the Housekeeping:1:Todo Any dependency management or refactor that would be nice to have some day. label Feb 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Housekeeping:1:Todo Any dependency management or refactor that would be nice to have some day.
Projects
None yet
Development

No branches or pull requests

1 participant