Skip to content

Throwing error on uncompiled templates #33

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

Merged
merged 1 commit into from
Oct 12, 2016

Conversation

EvanLovely
Copy link
Member

When a Twig template contains a namespace powered path like {% include "@atoms/buttons/button.twig" %} and the file is not present, then there is no error thrown currently and the outputted Pattern simply contains this:

2016-10-12 at 2 29 pm

Silent errors are the worst. This is caused by Twig_Loader_String being the last Twig Loader in the Twig_Loader_Chain and will try to render anything thrown at it and is simply doing that above. This PR ensures that if any rendered result starts with @, then an error is thrown. I consider it a stopgap until Twig_Loader_Chain is removed as it is currently deprecated and even contains the internal note to "NEVER use".

@EvanLovely EvanLovely merged commit e1dec43 into master Oct 12, 2016
@EvanLovely EvanLovely deleted the feature/error-on-uncompiled-pattern branch October 12, 2016 21:33
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.

1 participant