BUGFIX #4857 Fixed potential bug where a file would just be uploaded to a random folder, also files can now be uploaded to the assets root properly

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.4@96993 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sean Harvey 2010-01-15 01:36:54 +00:00 committed by Sam Minnee
parent 51ad525b69
commit cb541e6333

View File

@ -174,10 +174,10 @@ JS
}
// get the folder to upload to.
if(isset($data['FolderID']) && $data['FolderID'] != "root") {
if(isset($data['FolderID']) && $data['FolderID'] && $data['FolderID'] != "root") {
$folder = DataObject::get_by_id('Folder', $data['FolderID']);
} else {
$folder = DataObject::get_one('Folder');
$folder = singleton('Folder');
}
foreach($processedFiles as $tmpFile) {