]> source.dussan.org Git - nextcloud-server.git/commitdiff
call getFileInfo to enforce a file cache entry for the new version, fix #6286
authorBjoern Schiessle <schiessle@owncloud.com>
Wed, 15 Jan 2014 10:37:47 +0000 (11:37 +0100)
committerBjoern Schiessle <schiessle@owncloud.com>
Wed, 15 Jan 2014 10:37:47 +0000 (11:37 +0100)
apps/files_versions/lib/versions.php

index 42a15612d673e3e3b21cd6310bc9b1b0b850d857..7e6cc818efb89cbb8b837424ecaf5a2962007704 100644 (file)
@@ -98,7 +98,6 @@ class Storage {
 
                        $files_view = new \OC\Files\View('/'.$uid .'/files');
                        $users_view = new \OC\Files\View('/'.$uid);
-                       $versions_view = new \OC\Files\View('/'.$uid.'/files_versions');
 
                        // check if filename is a directory
                        if($files_view->is_dir($filename)) {
@@ -132,7 +131,10 @@ class Storage {
                        \OC_FileProxy::$enabled = false;
 
                        // store a new version of a file
-                       $users_view->copy('files'.$filename, 'files_versions'.$filename.'.v'.$users_view->filemtime('files'.$filename));
+                       $mtime = $users_view->filemtime('files'.$filename);
+                       $users_view->copy('files'.$filename, 'files_versions'.$filename.'.v'. $mtime);
+                       // call getFileInfo to enforce a file cache entry for the new version
+                       $users_view->getFileInfo('files_versions'.$filename.'.v'.$mtime);
 
                        // reset proxy state
                        \OC_FileProxy::$enabled = $proxyStatus;