FIX has_one File form scaffolding

Only allow selection of a single file when scaffolding has_one File relationship (fixes #8862)
This commit is contained in:
Jonathon Menz 2019-03-25 15:49:38 -07:00
parent 80f83b9043
commit fae19c16b5

View File

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