Permalink
Browse files

BUGFIX Ensure that a single string value (as opposed to an array of

values) is accepted by implode() in CheckboxSetField by casting it
as an array.
  • Loading branch information...
1 parent 86bdd16 commit 3f68e6f82f1283881e4b807383ff16b58ff57776 @halkyon halkyon committed Jun 11, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 forms/CheckboxSetField.php
View
4 forms/CheckboxSetField.php
@@ -179,15 +179,15 @@ function saveInto(DataObjectInterface $record) {
if($fieldname && $record && $relation && $relation instanceof RelationList) {
$idList = array();
if($this->value) foreach($this->value as $id => $bool) {
- if($bool) {
+ if($bool) {
$idList[] = $id;
}
}
$relation->setByIDList($idList);
} elseif($fieldname && $record) {
if($this->value) {
$this->value = str_replace(',', '{comma}', $this->value);
- $record->$fieldname = implode(",", $this->value);
+ $record->$fieldname = implode(',', (array) $this->value);
} else {
$record->$fieldname = '';
}

0 comments on commit 3f68e6f

Please sign in to comment.