Merge remote-tracking branch 'origin/4.3' into 4

This commit is contained in:
Robbie Averill 2017-06-13 12:57:46 +12:00
commit 89656e8ac9
4 changed files with 8 additions and 4 deletions

View File

@ -24,7 +24,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('Value')->keys());
}
$this->doUpdateFormField($field);

View File

@ -62,7 +62,7 @@ class EditableDropdown extends EditableMultipleOptionField
// Set default
$defaultOption = $this->getDefaultOptions()->first();
if ($defaultOption) {
$field->setValue($defaultOption->EscapedTitle);
$field->setValue($defaultOption->Value);
}
$this->doUpdateFormField($field);
return $field;

View File

@ -75,12 +75,16 @@ class EditableOption extends DataObject
return $this->canEdit($member);
}
/**
* @deprecated 5.0 Use "$Title.XML" in templates instead
* @return string
*/
public function getEscapedTitle()
{
return Convert::raw2att($this->Title);
}
/**
/**
* @param Member $member
* @return bool
*/

View File

@ -34,7 +34,7 @@ class EditableRadioField extends EditableMultipleOptionField
// Set default item
$defaultOption = $this->getDefaultOptions()->first();
if ($defaultOption) {
$field->setValue($defaultOption->EscapedTitle);
$field->setValue($defaultOption->Value);
}
$this->doUpdateFormField($field);
return $field;