From 4a49c5559650f7a6d0f4824bbf8b8e4f0d657eba Mon Sep 17 00:00:00 2001 From: cdujeu Date: Tue, 5 May 2015 14:39:42 +0200 Subject: [PATCH] Fix Jumploader not correctly sending node.change event (thus missing indexation) --- .../uploader.jumploader/class.JumploaderProcessor.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/core/src/plugins/uploader.jumploader/class.JumploaderProcessor.php b/core/src/plugins/uploader.jumploader/class.JumploaderProcessor.php index 754cc37306..3f94583314 100644 --- a/core/src/plugins/uploader.jumploader/class.JumploaderProcessor.php +++ b/core/src/plugins/uploader.jumploader/class.JumploaderProcessor.php @@ -391,7 +391,8 @@ public function postProcess($action, $httpVars, $postProcessData) $newFile["destination"] = $partitions[0]["destination"]; $newPartitions[] = $newFile; } else { - $newDest = fopen($destStreamURL.$httpVars["partitionRealName"], "w"); + $current = $destStreamURL.$httpVars["partitionRealName"]; + $newDest = fopen($current, "w"); $fileHash = md5($httpVars["partitionRealName"]); for ($i = 0; $i < $httpVars["partitionCount"] ; $i++) { @@ -410,14 +411,17 @@ public function postProcess($action, $httpVars, $postProcessData) } if (!self::$remote && (!self::$wrapperIsRemote || $relPath != $httpVars["partitionRealName"])) { - $err = copy($current, $target); + if($current != $target){ + $err = copy($current, $target); + } + else $err = true; } else { for ($i=0, $count=count($newPartitions); $i<$count; $i++) { $driver->storeFileToCopy($newPartitions[$i]); } } - if ($err !== false) { + if ($current != $target && $err !== false) { if(!self::$remote) unlink($current); AJXP_Controller::applyHook("node.change", array(null, new AJXP_Node($target), false)); } else if ($current == $target) {