Skip to content

Commit

Permalink
API Rename FormField Value to getFormattedValue
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Jan 29, 2025
1 parent 971ba30 commit 6a92ece
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion code/FormField/UserFormsCheckboxSetField.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function getOptions()

public function getValueForValidation(): mixed
{
$value = $this->Value();
$value = $this->getValue();
if (is_iterable($value) || is_null($value)) {
return $value;
}
Expand Down
6 changes: 2 additions & 4 deletions code/Model/Submission/SubmittedFileField.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,8 @@ class SubmittedFileField extends SubmittedFormField
/**
* Return the value of this field for inclusion into things such as
* reports.
*
* @return string
*/
public function getFormattedValue()
public function getFormattedValue(): ?DBField
{
$name = $this->getFileName();
$link = $this->getLink(false);
Expand Down Expand Up @@ -77,7 +75,7 @@ public function getFormattedValue()
));
}
}
return false;
return null;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function testDefaultValue()
/** @var EditableCountryDropdownField $field */
$field = EditableCountryDropdownField::create();
$field->Default = 'nz';
$this->assertEquals($field->getFormField()->Value(), 'nz');
$this->assertEquals($field->getFormField()->getValue(), 'nz');
}

public function testEmptyDefaultValue()
Expand Down

0 comments on commit 6a92ece

Please sign in to comment.