diff --git a/code/FileAttachmentField.php b/code/FileAttachmentField.php index 60258da..5345908 100644 --- a/code/FileAttachmentField.php +++ b/code/FileAttachmentField.php @@ -210,8 +210,8 @@ public function saveInto(DataObjectInterface $record) { } } - if(($relation = $this->getRelation()) && is_array($this->Value())) { - $relation->setByIDList($this->Value()); + if(($relation = $this->getRelation())) { + $relation->setByIDList((array) $this->Value()); } elseif($record->has_one($fieldname)) { $record->{"{$fieldname}ID"} = $this->Value() ?: 0; } elseif($record->hasField($fieldname)) {