Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
The storage is not static anymore
Don't call twice $cache->getId

Signed-off-by: Carl Schwan <[email protected]>
  • Loading branch information
CarlSchwan committed Jan 13, 2022
commit 0479fff37cb08157d982c593ce21fb79957e8574
26 changes: 11 additions & 15 deletions apps/workflowengine/lib/Check/FileSystemTags.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,22 +140,18 @@ protected function getSystemTags() {
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();
Expand All @@ -173,7 +169,7 @@ protected function getFileIds(ICache $cache, $path, $isExternalStorage) {

$fileId = $cache->getId($path);
if ($fileId !== -1) {
$parentIds[] = $cache->getId($path);
$parentIds[] = $fileId;
}

$this->fileIds[$cacheId][$path] = $parentIds;
Expand Down