You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you extend a template that doesn't exist in an element partial template, you get the fallback behaviour (e.g. Entry 123) instead of an exception view. That's because ElementHelper::renderElements() catches all errors of type TwigLoaderError to catch when an element partial doesn't exist, but that's the same error that's thrown when extending a template that doesn't exist.
What happened?
Description
If you extend a template that doesn't exist in an element partial template, you get the fallback behaviour (e.g.
Entry 123
) instead of an exception view. That's becauseElementHelper::renderElements()
catches all errors of typeTwigLoaderError
to catch when an element partial doesn't exist, but that's the same error that's thrown when extending a template that doesn't exist.I've opened a PR to fix this: #15177
Steps to reproduce
_partials/entry/home
and inside, extend a non-existant template:{{ entry.render() }}
Expected behavior
Every error in element partials should show regular exception views.
Actual behavior
The error is silently discarded and the fallback behaviour of showing a string representation is used.
Craft CMS version
5.1.10
PHP version
8.3
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions
The text was updated successfully, but these errors were encountered: