diff --git a/code/model/editableformfields/EditableCheckboxGroupField.php b/code/model/editableformfields/EditableCheckboxGroupField.php index f98faf3..b80554a 100755 --- a/code/model/editableformfields/EditableCheckboxGroupField.php +++ b/code/model/editableformfields/EditableCheckboxGroupField.php @@ -22,7 +22,7 @@ class EditableCheckboxGroupField extends EditableMultipleOptionField // Set the default checked items $defaultCheckedItems = $this->getDefaultOptions(); if ($defaultCheckedItems->count()) { - $field->setDefaultItems($defaultCheckedItems->map('EscapedTitle')->keys()); + $field->setDefaultItems($defaultCheckedItems->map('EscapedValue')->keys()); } $this->doUpdateFormField($field); diff --git a/code/model/editableformfields/EditableDropdown.php b/code/model/editableformfields/EditableDropdown.php index a576c1a..d175f23 100755 --- a/code/model/editableformfields/EditableDropdown.php +++ b/code/model/editableformfields/EditableDropdown.php @@ -38,7 +38,7 @@ class EditableDropdown extends EditableMultipleOptionField // Set default $defaultOption = $this->getDefaultOptions()->first(); if ($defaultOption) { - $field->setValue($defaultOption->EscapedTitle); + $field->setValue($defaultOption->EscapedValue); } $this->doUpdateFormField($field); return $field; diff --git a/code/model/editableformfields/EditableOption.php b/code/model/editableformfields/EditableOption.php index 5062ec2..040a29b 100644 --- a/code/model/editableformfields/EditableOption.php +++ b/code/model/editableformfields/EditableOption.php @@ -80,7 +80,12 @@ class EditableOption extends DataObject return Convert::raw2att($this->Title); } - /** + public function getEscapedValue() + { + return Convert::raw2att($this->Value); + } + + /** * @param Member $member * @return bool */ diff --git a/code/model/editableformfields/EditableRadioField.php b/code/model/editableformfields/EditableRadioField.php index 745c757..e4fd4ac 100755 --- a/code/model/editableformfields/EditableRadioField.php +++ b/code/model/editableformfields/EditableRadioField.php @@ -34,7 +34,7 @@ class EditableRadioField extends EditableMultipleOptionField // Set default item $defaultOption = $this->getDefaultOptions()->first(); if ($defaultOption) { - $field->setValue($defaultOption->EscapedTitle); + $field->setValue($defaultOption->EscapedValue); } $this->doUpdateFormField($field); return $field;