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

Rename FormField Value() to getFormattedValue() #11468

Open
4 tasks
emteknetnz opened this issue Nov 14, 2024 · 0 comments
Open
4 tasks

Rename FormField Value() to getFormattedValue() #11468

emteknetnz opened this issue Nov 14, 2024 · 0 comments

Comments

@emteknetnz
Copy link
Member

emteknetnz commented Nov 14, 2024

Split off from #11449 (comment)

FormField::getValue() was added in #11422 when implementing FieldValidation on FormFields

getValue() is confusing alongside Value() which should really be called getFormattedValue() as the method will often return a formatted version $this->value, which seems like it's intended for use within templates. It also looks like it's used a lot inside FormFields as $this->Value(), $this->getValue() should probably be used instead.

Acceptance criteria

  • Rename FormField::Value() to FormField::getFormattedValue()
  • Update FormFIeld code that used $this->Value() to use $this->getValue() instead where appropriate
  • Check templates and use $FormattedValue instead of $Value
  • Changelog calls out that projects and modules will need to update their templates
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants