Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #532 from halkyon/filesystem_sync_fix

BUGFIX "Sync files" button doesn't work when syncing the root of the assets
  • Loading branch information...
commit a96659ba8bb6b543ea9a2ce73d72f6435c07a72a 2 parents 5fa1633 + 72fd012
@chillu chillu authored
Showing with 9 additions and 5 deletions.
  1. +9 −5 filesystem/Folder.php
View
14 filesystem/Folder.php
@@ -128,13 +128,17 @@ function syncChildren() {
}
}
$unwantedDbChildren = $hasDbChild;
-
-
+
+ // if we're syncing a folder with no ID, we assume we're syncing the root assets folder
+ // however the Filename field is populated with "NewFolder", so we need to set this to empty
+ // to satisfy the baseDir variable below, which is the root folder to scan for new files in
+ if(!$parentID) $this->Filename = '';
+
// Iterate through the actual children, correcting the database as necessary
$baseDir = $this->FullPath;
-
- if(!$this->Filename) die($this->ID . " - " . $this->FullPath);
-
+
+ // @todo this shouldn't call die() but log instead
+ if($parentID && !$this->Filename) die($this->ID . " - " . $this->FullPath);
if(file_exists($baseDir)) {
$actualChildren = scandir($baseDir);
Please sign in to comment.
Something went wrong with that request. Please try again.