mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
BUGFIX "Sync files" button doesn't work when syncing the root of the assets folder
This commit is contained in:
parent
04e5ff09ca
commit
72fd0128c4
@ -129,12 +129,16 @@ class Folder extends File {
|
|||||||
}
|
}
|
||||||
$unwantedDbChildren = $hasDbChild;
|
$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
|
// Iterate through the actual children, correcting the database as necessary
|
||||||
$baseDir = $this->FullPath;
|
$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)) {
|
if(file_exists($baseDir)) {
|
||||||
$actualChildren = scandir($baseDir);
|
$actualChildren = scandir($baseDir);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user