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

API Deprecate FormField Value #11551

Merged
merged 1 commit into from
Jan 29, 2025

Conversation

emteknetnz
Copy link
Member

Issue #11468

@emteknetnz emteknetnz force-pushed the pulls/5/depr-ffv branch 2 times, most recently from 8bcc796 to 825cf40 Compare January 23, 2025 00:24
@emteknetnz emteknetnz marked this pull request as ready for review January 26, 2025 21:40
src/Forms/FormField.php Outdated Show resolved Hide resolved
src/Forms/TextareaField.php Outdated Show resolved Hide resolved
@emteknetnz emteknetnz force-pushed the pulls/5/depr-ffv branch 2 times, most recently from 075eb8f to be6374a Compare January 27, 2025 21:54
src/Forms/FormField.php Outdated Show resolved Hide resolved
Copy link
Member

@GuySartorelli GuySartorelli left a comment

Choose a reason for hiding this comment

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

If we're telling people to use the new methods instead, we need to also implement them in all the places that currently override Value() so that they get the correct value when calling methods on those classes.

The easier way would be to reverse your implementation so that getFormattedValue() for now calls return $this->Value(); which means overridden versions of Value() also apply that overridden value when calling getFormattedValue().

I'd do the latter personally as it's a lot less work and less prone to have unexpected regressions.

@emteknetnz emteknetnz force-pushed the pulls/5/depr-ffv branch 2 times, most recently from db88a5f to 7e88a6d Compare January 29, 2025 20:59
@emteknetnz
Copy link
Member Author

Spoke offline and agreed to remove the aliases and reverted the deprecation message to how it was.

Copy link
Member

@GuySartorelli GuySartorelli left a comment

Choose a reason for hiding this comment

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

LGTM.

@GuySartorelli GuySartorelli merged commit 6e3e655 into silverstripe:5 Jan 29, 2025
17 checks passed
@GuySartorelli GuySartorelli deleted the pulls/5/depr-ffv branch January 29, 2025 22:00
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