Skip to content

Commit

Permalink
Merge pull request #141 from xerc/master
Browse files Browse the repository at this point in the history
  • Loading branch information
lochmueller authored May 31, 2024
2 parents cb85ae0 + 531ecfb commit 12c691f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Classes/Service/SvgStoreService.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,14 @@ private function addFileToSpriteArr(string $hash, string $path, array $attr = []

private function populateCache(): bool
{
$storageArr = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Resource\StorageRepository::class)->findAll();
$storageArr = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Resource\StorageRepository::class)->findByStorageType('Local');
foreach ($storageArr as $storage) {
if ('relative' == $storage->getConfiguration()['pathType']) {
$storageArr[$storage->getUid()] = rtrim($storage->getConfiguration()['basePath'], '/'); // [^/]$
$storageConfig = $storage->getConfiguration();
if (!is_array($storageConfig) || !isset($storageConfig['pathType'], $storageConfig['basePath'])) {
continue;
}
if ('relative' == $storageConfig['pathType']) {
$storageArr[$storage->getUid()] = rtrim($storageConfig['basePath'], '/'); // [^/]$
}
}
unset($storageArr[0]); // keep!
Expand Down

0 comments on commit 12c691f

Please sign in to comment.