From b36023e8441340b851f8186982c5f0ab383c5b23 Mon Sep 17 00:00:00 2001 From: Benjamin Hirsch Date: Mon, 24 Jul 2017 19:29:56 +0200 Subject: [PATCH] Fixed a problem with blobs in default folder --- Classes/Driver/StorageDriver.php | 13 ++++++++++--- ext_emconf.php | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Classes/Driver/StorageDriver.php b/Classes/Driver/StorageDriver.php index 1f33720..f2b1389 100644 --- a/Classes/Driver/StorageDriver.php +++ b/Classes/Driver/StorageDriver.php @@ -1026,8 +1026,15 @@ public function countFoldersInFolder($folderIdentifier, $recursive = false, arra $blob = $iterator->current(); // go on to the next iterator item now as we might skip this one early $iterator->next(); - if ($this->isFolder(str_replace($folderIdentifier, '', $blob->getName()))) { - $folders++; + + if ($folderIdentifier === $this->getDefaultFolder()) { + if ($this->isFolder($blob->getName()) && substr_count($blob->getName(), '/') == 1) { + $folders++; + } + } else { + if ($this->isFolder(str_replace($folderIdentifier, '', $blob->getName()))) { + $folders++; + } } } @@ -1189,7 +1196,7 @@ protected function createBlockBlob($name, $content = '', CreateBlobOptions $opti */ protected function getBlobsFromFolder($sourceFolderIdentifier) { - return $this->getListBlobs($sourceFolderIdentifier); + return $this->getListBlobs($sourceFolderIdentifier); } /** diff --git a/ext_emconf.php b/ext_emconf.php index 9216679..3f43704 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -4,7 +4,7 @@ 'title' => 'Azure Storage', 'description' => 'Microsoft Azure Blob Storage for TYPO3', 'category' => 'be', - 'version' => '0.4.0', + 'version' => '0.4.1', 'state' => 'beta', 'clearcacheonload' => 1, 'author' => 'Benjamin Hirsch',