MINOR Checking for success of file upload before trying to add metadata in AssetAdmin->doUpload() (AIR-37)

This commit is contained in:
Ingo Schommer 2011-09-01 14:49:23 +02:00
parent 089973803b
commit 093eb6cd53

View File

@ -225,8 +225,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());
@ -239,6 +238,7 @@ JS
}
}
}
}
if($newFiles) {
$numFiles = sizeof($newFiles);