summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorRichard Steinmetz <richard@steinmetz.cloud>2021-09-14 16:04:02 +0200
committerGitHub <noreply@github.com>2021-09-14 16:04:02 +0200
commit9501e1be64578b92c13e5685c27f35223b2ccd7d (patch)
treeddaeaa1d260b4477bdca1c24d4ca4f78eac58565 /apps
parent8e7f63b2749c3fe6058cebcab5cfa6ff0424d02f (diff)
parent8bd8e9718181aedfd2da9ebded1baea66d97f8f4 (diff)
downloadnextcloud-server-9501e1be64578b92c13e5685c27f35223b2ccd7d.tar.gz
nextcloud-server-9501e1be64578b92c13e5685c27f35223b2ccd7d.zip
Merge pull request #28774 from nextcloud/fix/noid/find-system-tags-of-nested-groupfolders
Do not cache file ids in FileSystemTags inside group folders
Diffstat (limited to 'apps')
-rw-r--r--apps/workflowengine/lib/Check/FileSystemTags.php12
1 files changed, 10 insertions, 2 deletions
diff --git a/apps/workflowengine/lib/Check/FileSystemTags.php b/apps/workflowengine/lib/Check/FileSystemTags.php
index b69f7492e02..a879a8e1703 100644
--- a/apps/workflowengine/lib/Check/FileSystemTags.php
+++ b/apps/workflowengine/lib/Check/FileSystemTags.php
@@ -6,6 +6,7 @@
* @author Christoph Wurst <christoph@winzerhof-wurst.at>
* @author Joas Schilling <coding@schilljs.com>
* @author Julius Härtl <jus@bitgrid.net>
+ * @author Richard Steinmetz <richard@steinmetz.cloud>
*
* @license GNU AGPL version 3 or any later version
*
@@ -131,8 +132,13 @@ class FileSystemTags implements ICheck, IFileCheck {
* @return int[]
*/
protected function getFileIds(ICache $cache, $path, $isExternalStorage) {
+ // TODO: Fix caching inside group folders
+ // Do not cache file ids inside group folders because multiple file ids might be mapped to
+ // the same combination of cache id + path.
+ $shouldCacheFileIds = !$this->storage
+ ->instanceOfStorage(\OCA\GroupFolders\Mount\GroupFolderStorage::class);
$cacheId = $cache->getNumericStorageId();
- if (isset($this->fileIds[$cacheId][$path])) {
+ if ($shouldCacheFileIds && isset($this->fileIds[$cacheId][$path])) {
return $this->fileIds[$cacheId][$path];
}
@@ -148,7 +154,9 @@ class FileSystemTags implements ICheck, IFileCheck {
$parentIds[] = $cache->getId($path);
}
- $this->fileIds[$cacheId][$path] = $parentIds;
+ if ($shouldCacheFileIds) {
+ $this->fileIds[$cacheId][$path] = $parentIds;
+ }
return $parentIds;
}