Commit 73488e21 authored by Mario's avatar Mario
Browse files

renaming a folder will also move its content - skip rename if $oldsotrepath...

renaming a folder will also move its content - skip rename if $oldsotrepath does not exist anymore. We still need to iterate e for the DB updates though.
parent f016adec
Pipeline #367685 passed with stage
in 5 minutes and 7 seconds
......@@ -2552,7 +2552,8 @@ function attach_move($channel_id, $resource_id, $new_folder_hash, $newname = '')
$newstorepath = 'store/' . $c['channel_address'] . '/' . $resource_id;
}
rename($oldstorepath,$newstorepath);
if (file_exists($oldstorepath))
rename($oldstorepath,$newstorepath);
// duplicate detection. If 'overwrite' is specified, return false because we can't yet do that.
......@@ -2671,7 +2672,7 @@ function attach_move($channel_id, $resource_id, $new_folder_hash, $newname = '')
);
if($x) {
foreach($x as $xv) {
$rs = attach_move($channel_id,$xv['hash'],$r[0]['hash']);
$rs = attach_move($channel_id, $xv['hash'], $r[0]['hash']);
if(! $rs) {
$move_success = false;
break;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment