[BUGFIX] FAL does not copy subfolders cleanly
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Classes / Resource / Driver / LocalDriver.php
index 993c970..a6db44b 100644 (file)
@@ -887,7 +887,7 @@ class LocalDriver extends \TYPO3\CMS\Core\Resource\Driver\AbstractDriver {
                mkdir($targetFolderPath);
                $sourceFolderPath = $this->getAbsolutePath($folderToCopy);
                /** @var $iterator \RecursiveDirectoryIterator */
-               $iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($sourceFolderPath));
+               $iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($sourceFolderPath), \RecursiveIteratorIterator::SELF_FIRST);
                while ($iterator->valid()) {
                        /** @var $current \RecursiveDirectoryIterator */
                        $current = $iterator->current();