]> source.dussan.org Git - nextcloud-server.git/commitdiff
remove some debug output; move code to the right function
authorBjörn Schießle <schiessle@owncloud.com>
Fri, 8 Mar 2013 10:27:25 +0000 (11:27 +0100)
committerBjörn Schießle <schiessle@owncloud.com>
Fri, 8 Mar 2013 10:27:25 +0000 (11:27 +0100)
apps/files_versions/lib/hooks.php
apps/files_versions/lib/versions.php
lib/files/view.php

index 6e81286052fc059c3e984e3b2993f6e7b7164331..7891b20e92fd2a74e6a28c3cd18d00a1e3efd9db 100644 (file)
@@ -21,12 +21,6 @@ class Hooks {
 
                if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') {
                        $path = $params[\OC\Files\Filesystem::signal_param_path];
-                       $pos = strrpos($path, '.part');
-                       if ($pos) {
-                               error_log("old path: $path");
-                               $path = substr($path, 0, $pos);
-                               error_log("new path: $path");
-                       }
                        if($path<>'') {
                                Storage::store($path);
                        }
index 79b16f2586f7c6ef83172e38e1bd5166b49baebd..20611c61ec7a7b2ae9303279b6167a0798bd6534 100644 (file)
@@ -82,6 +82,14 @@ class Storage {
         */
        public static function store($filename) {
                if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') {
+                       
+                       // if the file gets streamed we need to remove the .part extension
+                       // to get the right target
+                       $ext = pathinfo($filename, PATHINFO_EXTENSION);
+                       if ($ext === 'part') {
+                               $filename = substr($filename, 0, strlen($filename)-5);
+                       }
+                       
                        list($uid, $filename) = self::getUidAndFilename($filename);
 
                        $files_view = new \OC\Files\View('/'.$uid .'/files');
index 59339ff207193bc818195d8a06fff539ba19beb2..fe753342b6c67e3df6e43b2eb131d4758f4bcca9 100644 (file)
@@ -603,7 +603,7 @@ class View {
                        if ($path == null) {
                                return false;
                        }
-                       foreach ($hooks as $h) if ($h == "write") error_log("write triggered by $operation for $path");
+
                        $run = $this->runHooks($hooks, $path);
                        list($storage, $internalPath) = Filesystem::resolvePath($absolutePath . $postFix);
                        if ($run and $storage) {