Chained properties result in errors if TemplateGlobalProvider returns null
#11330
Closed
2 tasks done
Labels
null
#11330
Module version(s) affected
>= 5.0.0
Description
If a method in a
TemplateGlobalProvider
returnsnull
, and you chain properties from it, the following error results:Relevant stack trace:
This seems to be a result of d6e8229 which was originally added in #8456 and rescued from the master branch in #10497
Based on the docs change that was made along side this, it looks like it was intended to be only for passing arguments around, not for intermediate
obj()
calls.How to reproduce
Add this
TemplateGlobalProvider
Then add this to any template:
Possible Solution
No response
Additional Context
This is a regression - in CMS 4 the
null
resulted in simply nothing returning in the template (which is how all othernull
is treated in the template layer).Validations
silverstripe/installer
(with any code examples you've provided)PRs
The text was updated successfully, but these errors were encountered: