From 3f68e6f82f1283881e4b807383ff16b58ff57776 Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Mon, 11 Jun 2012 13:39:18 +1200 Subject: [PATCH] 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. --- forms/CheckboxSetField.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/forms/CheckboxSetField.php b/forms/CheckboxSetField.php index 11b623389..d6e158905 100644 --- a/forms/CheckboxSetField.php +++ b/forms/CheckboxSetField.php @@ -179,7 +179,7 @@ class CheckboxSetField extends OptionsetField { if($fieldname && $record && $relation && $relation instanceof RelationList) { $idList = array(); if($this->value) foreach($this->value as $id => $bool) { - if($bool) { + if($bool) { $idList[] = $id; } } @@ -187,7 +187,7 @@ class CheckboxSetField extends OptionsetField { } 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 = ''; }