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 Rename FormField Value to getFormattedValue #1363

Draft
wants to merge 1 commit into
base: 7.0
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<% if $Options.Count %>
<% loop $Options %>
<div class="$Class">
<input id="$ID" class="checkbox" name="$Name" type="checkbox" value="$Value.ATT"<% if $isChecked %>
<input id="$ID" class="checkbox" name="$Name" type="checkbox" value="$FormattedValue.ATT"<% if $isChecked %>
checked="checked"<% end_if %><% if $isDisabled %> disabled="disabled"<% end_if %>
$Top.getValidationAttributesHTML().RAW />
<label for="$ID">$Title.XML</label>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<% loop $Options %>
<div class="$Class">
<input id="$ID" class="radio" name="$Name" type="radio" value="$Value.ATT"<% if $isChecked %>
<input id="$ID" class="radio" name="$Name" type="radio" value="$FormattedValue.ATT"<% if $isChecked %>
checked<% end_if %><% if $isDisabled %> disabled<% end_if %> <% if $Up.Required %>required<% end_if %>
$Top.getValidationAttributesHTML().RAW />
<label for="$ID">$Title</label>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<select $AttributesHTML<% if $RightTitle %> aria-describedby="{$Name}_right_title"<% end_if %>>
<% loop $Options %>
<option value="$Value.XML"<% if $Selected %> selected="selected"<% end_if %><% if $Disabled %> disabled="disabled"<% end_if %>>$Title.XML</option>
<option value="$FormattedValue.XML"<% if $Selected %> selected="selected"<% end_if %><% if $Disabled %> disabled="disabled"<% end_if %>>$Title.XML</option>
<% end_loop %>
</select>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<textarea $AttributesHTML<% if $RightTitle %> aria-describedby="{$Name}_right_title"<% end_if %>>$Value.HTMLATT</textarea>
<textarea $AttributesHTML<% if $RightTitle %> aria-describedby="{$Name}_right_title"<% end_if %>>$FormattedValue.HTMLATT</textarea>
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
Loading