mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
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:
commit
2073ac85c2
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user