diff --git a/forms/FileField.php b/forms/FileField.php index 3213e41ac..b74a000a4 100755 --- a/forms/FileField.php +++ b/forms/FileField.php @@ -11,7 +11,7 @@ class FileField extends FormField { public function saveInto(DataObject $record) { $fieldName = $this->name . 'ID'; - $hasOnes = $record->has_one($fieldName); + $hasOnes = $record->has_one(/*$fieldName*/$this->name); // assume that the file is connected via a has-one if( !$hasOnes )