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

Admin crashes when system.twig.undefined_functions = false #2138

Closed
yankl opened this issue May 3, 2021 · 3 comments
Closed

Admin crashes when system.twig.undefined_functions = false #2138

yankl opened this issue May 3, 2021 · 3 comments
Assignees
Labels

Comments

@yankl
Copy link
Contributor

yankl commented May 3, 2021

I was getting tired of Twig failing silently when I accidently used an undefined function in my code (e.g. if I forgot to import it), as it made it harder to debug. So I changed system.twig.undefined_functions to false, which had the intended effect of crashing the site with an error with the undefined function in the template instead of just printing nothing.

However, this also seems to cause the Admin plugin to crash on various occasions. I was able to reproduce it in a fresh install by saving at configuration (so that the variable option appears in my user/config/system.yaml) switching the variable there, clearing the cache from the admin plugin, and then going to the Configuration page, where I get this:

image

Or, if I try to go to my admin user page, I get this:

image

Is the Admin plugin not supposed to be able to work with this variable set to false? If so are there any suggestions for making debugging Twig templates easier besides setting undefined_functions to false?

I'm on Grav v1.7.14 - Admin v1.10.14.

@mahagr mahagr self-assigned this May 10, 2021
@mahagr mahagr added the bug label May 10, 2021
@mahagr
Copy link
Member

mahagr commented May 10, 2021

Fixed a few: getgrav/grav@7d01977

@mahagr
Copy link
Member

mahagr commented May 10, 2021

Not sure what to do with base64 methods -- they are already defined as filters, but not functions. @rhukster ?

@rhukster
Copy link
Member

I changed the functions to filters

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

No branches or pull requests

3 participants