mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 06:05:56 +00:00
MINOR Checking for success of file upload before trying to add metadata in AssetAdmin->doUpload() (AIR-37)
This commit is contained in:
parent
6b9b0ef161
commit
d81f882b4f
@ -255,8 +255,7 @@ JS
|
||||
|
||||
// move file to given folder
|
||||
if($valid) {
|
||||
$newFile = $folder->addUploadToFolder($tmpFile);
|
||||
|
||||
if($newFile = $folder->addUploadToFolder($tmpFile)) {
|
||||
if(self::$metadata_upload_enabled && isset($processedData[$filePostId])) {
|
||||
$fileObject = DataObject::get_by_id('File', $newFile);
|
||||
$metadataForm = new Form($this, 'MetadataForm', $fileObject->uploadMetadataFields(), new FieldSet());
|
||||
@ -269,6 +268,7 @@ JS
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($newFiles) {
|
||||
$numFiles = sizeof($newFiles);
|
||||
|
Loading…
x
Reference in New Issue
Block a user