Skip to content
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

NEW Access dynamic data inside ViewableData #10698

Merged

Conversation

emteknetnz
Copy link
Member

Issue #10684

Makes the "dynamic properties" added for PHP 8.2 support accessible from anywhere, including classes that overload getField() etc

return $this;
throw new InvalidArgumentException(implode(' ', [
"Field $field does not exist.",
'If this was accessed via a dynamic property then use ViewableData::setDynamicData() instead.'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'If this was accessed via a dynamic property then use ViewableData::setDynamicData() instead.'
'If this was accessed via a dynamic property then use setDynamicData() instead.'

We don't call ViewableData::setDynamicData('myProperty'), we just call setDynamicData on the instance of DBComposite.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated. Also added unit test for the exception

@emteknetnz emteknetnz force-pushed the pulls/5.0/dynamic-data branch from b280100 to 0075bf6 Compare February 21, 2023 20:40
@GuySartorelli GuySartorelli merged commit 469bac8 into silverstripe:5.0 Feb 21, 2023
@GuySartorelli GuySartorelli deleted the pulls/5.0/dynamic-data branch February 21, 2023 21:09
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.

2 participants