From 762636efcd9519eada0e39de5ab5fb048c9881ef Mon Sep 17 00:00:00 2001
From: Lukas Reschke <lukas@owncloud.com>
Date: Wed, 10 Feb 2016 12:30:39 +0100
Subject: [PATCH] Use cache directly instead of QB

In case somebody does not use oc_filecache
---
 apps/files_versions/lib/storage.php | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/apps/files_versions/lib/storage.php b/apps/files_versions/lib/storage.php
index 0b121c344f9..d5e21959698 100644
--- a/apps/files_versions/lib/storage.php
+++ b/apps/files_versions/lib/storage.php
@@ -169,11 +169,8 @@ class Storage {
 
 			// Keep the "encrypted" value of the original file
 			$oldVersion = $files_view->getFileInfo($filename)->getEncryptedVersion();
-			$qb = \OC::$server->getDatabaseConnection()->getQueryBuilder();
-			$qb->update('filecache')
-				->set('encrypted', $qb->createNamedParameter($oldVersion))
-				->where($qb->expr()->eq('fileid', $qb->createNamedParameter($newFileInfo->getId())))
-				->execute();
+			$cache = $newFileInfo->getStorage()->getCache();
+			$cache->update($newFileInfo->getId(), ['encrypted' => $oldVersion, 'encryptedVersion' => $oldVersion]);
 		}
 	}
 
-- 
GitLab