Skip to content
Snippets Groups Projects
Commit 8d26400c authored by Björn Schießle's avatar Björn Schießle
Browse files

remove some debug output; move code to the right function

parent 45869afa
No related branches found
No related tags found
No related merge requests found
......@@ -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);
}
......
......@@ -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');
......
......@@ -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) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment