Merge pull request #8879 from jonom/fix-has-one-file-scaffold

FIX Allow only one file when scaffolding has_one File relationship
This commit is contained in:
Loz Calver 2019-03-27 09:16:50 +00:00 committed by GitHub
commit 2073ac85c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -55,6 +55,9 @@ class DBForeignKey extends DBInt
if ($hasOneSingleton instanceof Image) {
$field->setAllowedFileCategories('image/supported');
}
if ($field->hasMethod('setAllowedMaxFileNumber')) {
$field->setAllowedMaxFileNumber(1);
}
return $field;
}