mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 17:05:42 +02:00
Merge pull request #132 from Focus-Flow/bug/quotes-in-editableoption-title
BUG: support quotes in EditableOption Title
This commit is contained in:
commit
3352fe38b0
@ -16,9 +16,9 @@ class EditableCheckboxGroupField extends EditableMultipleOptionField {
|
|||||||
public function getFormField() {
|
public function getFormField() {
|
||||||
$optionSet = $this->Options();
|
$optionSet = $this->Options();
|
||||||
$options = array();
|
$options = array();
|
||||||
|
|
||||||
$optionMap = ($optionSet) ? $optionSet->map('Title', 'Title') : array();
|
$optionMap = ($optionSet) ? $optionSet->map('EscapedTitle', 'Title') : array();
|
||||||
|
|
||||||
return new CheckboxSetField($this->Name, $this->Title, $optionMap);
|
return new CheckboxSetField($this->Name, $this->Title, $optionMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -40,4 +40,4 @@ class EditableCheckboxGroupField extends EditableMultipleOptionField {
|
|||||||
}
|
}
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -70,4 +70,8 @@ class EditableOption extends DataObject {
|
|||||||
$this->readonly = true;
|
$this->readonly = true;
|
||||||
return $this->EditSegment();
|
return $this->EditSegment();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
public function getEscapedTitle() {
|
||||||
|
return Convert::raw2att($this->Title);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -19,7 +19,7 @@ class EditableRadioField extends EditableMultipleOptionField {
|
|||||||
|
|
||||||
if($optionSet) {
|
if($optionSet) {
|
||||||
foreach( $optionSet as $option ) {
|
foreach( $optionSet as $option ) {
|
||||||
$options[$option->Title] = $option->Title;
|
$options[$option->EscapedTitle] = $option->Title;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user