diff options
author | Robin Appelman <robin@icewind.nl> | 2019-10-31 14:57:39 +0100 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2019-11-13 12:39:46 +0100 |
commit | 066faaec058ba487f214463d1b53603aaeaad646 (patch) | |
tree | 6425d460f912302a34f691b2b381b794ebd225e5 /lib/private | |
parent | 43fa746ad9eeb8c4596a33aa5b0d9a423dee4da4 (diff) | |
download | nextcloud-server-066faaec058ba487f214463d1b53603aaeaad646.tar.gz nextcloud-server-066faaec058ba487f214463d1b53603aaeaad646.zip |
fix folder delete
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/Files/Cache/Cache.php | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/private/Files/Cache/Cache.php b/lib/private/Files/Cache/Cache.php index dd063903058..f3081e7b18b 100644 --- a/lib/private/Files/Cache/Cache.php +++ b/lib/private/Files/Cache/Cache.php @@ -548,8 +548,14 @@ class Cache implements ICache { * @throws \OC\DatabaseException */ private function removeChildren(ICacheEntry $entry) { - $subFolders = $this->getSubFolders($entry); - foreach ($subFolders as $folder) { + $children = $this->getFolderContentsById($entry->getId()); + $childIds = array_map(function(ICacheEntry $cacheEntry) { + return $cacheEntry->getId(); + }, $children); + $childFolders = array_filter($children, function ($child) { + return $child->getMimeType() == FileInfo::MIMETYPE_FOLDER; + }); + foreach ($childFolders as $folder) { $this->removeChildren($folder); } @@ -560,7 +566,7 @@ class Cache implements ICache { $query = $this->getQueryBuilder(); $query->delete('filecache_extended') - ->whereParent($entry->getId()); + ->where($query->expr()->in('fileid', $query->createNamedParameter($childIds, IQueryBuilder::PARAM_INT_ARRAY))); $query->execute(); } |