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:
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".
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:Silent errors are the worst. This is caused by
Twig_Loader_String
being the last Twig Loader in theTwig_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 untilTwig_Loader_Chain
is removed as it is currently deprecated and even contains the internal note to "NEVER use".