summaryrefslogtreecommitdiffstats
path: root/apps/workflowengine
diff options
context:
space:
mode:
authorCarl Schwan <carl@carlschwan.eu>2022-01-07 17:55:02 +0100
committerCarl Schwan <carl@carlschwan.eu>2022-01-13 10:39:36 +0100
commit0479fff37cb08157d982c593ce21fb79957e8574 (patch)
treec6b6b79446f1cd31c807dface208e04a84eee350 /apps/workflowengine
parent1f392d666af950da2209f1cf346885c991183d81 (diff)
downloadnextcloud-server-0479fff37cb08157d982c593ce21fb79957e8574.tar.gz
nextcloud-server-0479fff37cb08157d982c593ce21fb79957e8574.zip
The storage is not static anymore
Don't call twice $cache->getId Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Diffstat (limited to 'apps/workflowengine')
-rw-r--r--apps/workflowengine/lib/Check/FileSystemTags.php26
1 files changed, 11 insertions, 15 deletions
diff --git a/apps/workflowengine/lib/Check/FileSystemTags.php b/apps/workflowengine/lib/Check/FileSystemTags.php
index f2b9b2a186b..b6ad95a4ab6 100644
--- a/apps/workflowengine/lib/Check/FileSystemTags.php
+++ b/apps/workflowengine/lib/Check/FileSystemTags.php
@@ -140,22 +140,18 @@ class FileSystemTags implements ICheck, IFileCheck {
protected function getFileIds(ICache $cache, $path, $isExternalStorage) {
/** @psalm-suppress InvalidArgument */
if ($this->storage->instanceOfStorage(\OCA\GroupFolders\Mount\GroupFolderStorage::class)) {
- static $groupFolderStorage = null;
- if ($groupFolderStorage === null) {
- // Special implementation for groupfolder since all groupfolder chare the same storage
- // so add the group folder id in the cache key too.
- $groupFolderStorage = $this->storage;
- $groupFolderStoragClass = \OCA\GroupFolders\Mount\GroupFolderStorage::class;
- while ($groupFolderStorage->instanceOfStorage(Wrapper::class)) {
- if ($groupFolderStorage instanceof $groupFolderStoragClass) {
- break;
- }
- /**
- * @var Wrapper $sourceStorage
- */
- $groupFolderStorage = $groupFolderStorage->getWrapperStorage();
+ // Special implementation for groupfolder since all groupfolders share the same storage
+ // id so add the group folder id in the cache key too.
+ $groupFolderStorage = $this->storage;
+ $groupFolderStorageClass = \OCA\GroupFolders\Mount\GroupFolderStorage::class;
+ while ($groupFolderStorage->instanceOfStorage(Wrapper::class)) {
+ if ($groupFolderStorage instanceof $groupFolderStorageClass) {
+ break;
}
+ /** @var Wrapper $groupFolderStorage */
+ $groupFolderStorage = $groupFolderStorage->getWrapperStorage();
}
+ /** @psalm-suppress UndefinedMethod */
$cacheId = $cache->getNumericStorageId() . '/' . $groupFolderStorage->getFolderId();
} else {
$cacheId = $cache->getNumericStorageId();
@@ -173,7 +169,7 @@ class FileSystemTags implements ICheck, IFileCheck {
$fileId = $cache->getId($path);
if ($fileId !== -1) {
- $parentIds[] = $cache->getId($path);
+ $parentIds[] = $fileId;
}
$this->fileIds[$cacheId][$path] = $parentIds;