Skip to content

Commit d41723b

Browse files
MC-41854: Page builder gallery load issue
1 parent a1da286 commit d41723b

File tree

1 file changed

+8
-9
lines changed
  • app/code/Magento/Cms/Block/Adminhtml/Wysiwyg/Images

1 file changed

+8
-9
lines changed

app/code/Magento/Cms/Block/Adminhtml/Wysiwyg/Images/Tree.php

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -89,24 +89,23 @@ public function getTreeJson()
8989
}
9090

9191
/**
92-
* Get nested directories without files
92+
* Check if directory has nested directories
9393
*
9494
* @param string $storageRoot
9595
* @param string $fileName
96-
* @return array
96+
* @return bool
9797
*/
98-
private function hasNestedDirectories(string $storageRoot, string $fileName): array
98+
private function hasNestedDirectories(string $storageRoot, string $fileName): bool
9999
{
100-
$result = [];
101100
$pathList = $this->getMediaDirectory()->read($fileName);
102101
foreach ($pathList as $directoryPath) {
103-
$directory = $this->_filesystem->getDirectoryReadByPath($storageRoot . $directoryPath);
104-
if (!$directory->isDirectory()) {
105-
continue;
102+
$file = $this->_filesystem->getDirectoryReadByPath($storageRoot . $directoryPath);
103+
if ($file->isDirectory()) {
104+
return true;
106105
}
107-
$result[] = $directoryPath;
108106
}
109-
return $result;
107+
108+
return false;
110109
}
111110

112111
/**

0 commit comments

Comments
 (0)