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
PHP methods and DataObject properties are case insensitive.
If you get some method or property case insensitively in a template, it will render the correct value but will fall back to the default casting.
Could this be caused by the mechanism when it's trying to get an existing method, perhaps in a case-sensitive way, and if it doesn't exist it tries to prepend get there and then the casting is not applied because the method name doesn't match with the get prefix?
I think the attached PR illustrates the cause pretty well - basically ViewableData::castingHelper() is using isset() to see if the field name is in its casting config - but isset() is case sensitive so of course the following will return false even though the field we want is in the config:
Affected Version: 4.x
Description
PHP methods and
DataObject
properties are case insensitive.If you get some method or property case insensitively in a template, it will render the correct value but will fall back to the default casting.
Steps to Reproduce
In a page class:
In a template:
Acceptance Criteria
PRs
The text was updated successfully, but these errors were encountered: