diff options
author | Robin Appelman <icewind@owncloud.com> | 2015-10-26 16:31:26 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2015-10-29 12:34:49 +0100 |
commit | 01d3393b7bd35cb54fc990a91b1b675efff9957a (patch) | |
tree | f7196b8c2fb2a662c527561a576da769f64c8f4d /lib | |
parent | 530f7229e77d731eead7f1dc74296c62856a345b (diff) | |
download | nextcloud-server-01d3393b7bd35cb54fc990a91b1b675efff9957a.tar.gz nextcloud-server-01d3393b7bd35cb54fc990a91b1b675efff9957a.zip |
include the final update in the transaction when moving a folder in the cache
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/files/cache/cache.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/private/files/cache/cache.php b/lib/private/files/cache/cache.php index 231dbe37695..71720ac58bf 100644 --- a/lib/private/files/cache/cache.php +++ b/lib/private/files/cache/cache.php @@ -485,6 +485,9 @@ class Cache { list($sourceStorageId, $sourcePath) = $sourceCache->getMoveInfo($sourcePath); list($targetStorageId, $targetPath) = $this->getMoveInfo($targetPath); + // sql for final update + $moveSql = 'UPDATE `*PREFIX*filecache` SET `storage` = ?, `path` = ?, `path_hash` = ?, `name` = ?, `parent` =? WHERE `fileid` = ?'; + if ($sourceData['mimetype'] === 'httpd/unix-directory') { //find all child entries $sql = 'SELECT `path`, `fileid` FROM `*PREFIX*filecache` WHERE `storage` = ? AND `path` LIKE ?'; @@ -498,11 +501,12 @@ class Cache { $newTargetPath = $targetPath . substr($child['path'], $sourceLength); \OC_DB::executeAudited($query, [$targetStorageId, $newTargetPath, md5($newTargetPath), $child['fileid']]); } + \OC_DB::executeAudited($moveSql, [$targetStorageId, $targetPath, md5($targetPath), basename($targetPath), $newParentId, $sourceId]); \OC_DB::commit(); + } else { + \OC_DB::executeAudited($moveSql, [$targetStorageId, $targetPath, md5($targetPath), basename($targetPath), $newParentId, $sourceId]); } - $sql = 'UPDATE `*PREFIX*filecache` SET `storage` = ?, `path` = ?, `path_hash` = ?, `name` = ?, `parent` =? WHERE `fileid` = ?'; - \OC_DB::executeAudited($sql, [$targetStorageId, $targetPath, md5($targetPath), basename($targetPath), $newParentId, $sourceId]); } /** |