Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorCarl Schwan <carl@carlschwan.eu>2022-01-07 19:55:02 +0300
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2022-01-14 17:16:53 +0300
commita735773d71b12805df9fe099c5b2f531df627c5d (patch)
tree956172338ef0087dc65fd918c383c015623a4057 /apps
parent31fb8d0c71e8c473b01210a0a4956dfeee237141 (diff)
The storage is not static anymore
Don't call twice $cache->getId Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Diffstat (limited to 'apps')
-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 fe87d1a89d2..d8377be91db 100644
--- a/apps/workflowengine/lib/Check/FileSystemTags.php
+++ b/apps/workflowengine/lib/Check/FileSystemTags.php
@@ -135,22 +135,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();
@@ -168,7 +164,7 @@ class FileSystemTags implements ICheck, IFileCheck {
$fileId = $cache->getId($path);
if ($fileId !== -1) {
- $parentIds[] = $cache->getId($path);
+ $parentIds[] = $fileId;
}
$this->fileIds[$cacheId][$path] = $parentIds;