Skip to content

Commit

Permalink
BUGFIX: is_array returning false negative for empty sets
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron Carlino committed May 31, 2016
1 parent d2944d8 commit 9de98bd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions code/FileAttachmentField.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit 9de98bd

Please sign in to comment.