Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

BUGFIX: Can't upload files to root folder

  • Loading branch information...
commit 7de585103f35dbcfbf9986ef78b0f6b50d213d33 1 parent 1f190eb
@slindqvist slindqvist authored
Showing with 5 additions and 2 deletions.
  1. +5 −2 code/controllers/AssetAdmin.php
View
7 code/controllers/AssetAdmin.php
@@ -202,8 +202,11 @@ function doUpload($data, $form) {
}
$processedData = array_reverse($processedData);
- if($data['FolderID'] && $data['FolderID'] != '') $folder = DataObject::get_by_id("Folder", $data['FolderID']);
- else $folder = singleton('Folder');
+ if(isset($data['FolderID']) && is_numeric($data['FolderID'])) {
+ $folder = DataObject::get_by_id("Folder", $data['FolderID']);
+ } else {
+ $folder = singleton('Folder');
+ }
foreach($processedFiles as $filePostId => $tmpFile) {
if($tmpFile['error'] == UPLOAD_ERR_NO_TMP_DIR) {
Please sign in to comment.
Something went wrong with that request. Please try again.