]> source.dussan.org Git - nextcloud-server.git/commitdiff
touch file relative to users file folder, otherwise the hooks will be ignored
authorBjörn Schießle <schiessle@owncloud.com>
Wed, 8 May 2013 13:05:03 +0000 (15:05 +0200)
committerBjörn Schießle <schiessle@owncloud.com>
Wed, 8 May 2013 20:59:49 +0000 (22:59 +0200)
apps/files_versions/lib/versions.php

index c38ba688fe086e4e8e0d72011b04a84d90d5ca5c..836e3914dc0705941d89bc655606098e3a9e03a1 100644 (file)
@@ -184,11 +184,12 @@ class Storage {
        /**
         * rollback to an old version of a file.
         */
-       public static function rollback($filename, $revision) {
+       public static function rollback($file, $revision) {
 
                if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') {
-                       list($uid, $filename) = self::getUidAndFilename($filename);
+                       list($uid, $filename) = self::getUidAndFilename($file);
                        $users_view = new \OC\Files\View('/'.$uid);
+                       $files_view = new \OC\Files\View('/'.\OCP\User::getUser().'/files');
                        $versionCreated = false;
 
                        //first create a new version
@@ -200,8 +201,8 @@ class Storage {
 
                        // rollback
                        if( @$users_view->copy('files_versions'.$filename.'.v'.$revision, 'files'.$filename) ) {
-                               $users_view->touch('files'.$filename, $revision);
-                               Storage::expire($filename);
+                               $files_view->touch($file, $revision);
+                               Storage::expire($file);
                                return true;
 
                        }else if ( $versionCreated ) {