Skip to content

Commit

Permalink
Merge pull request #3653 from terrafrost/branch-1
Browse files Browse the repository at this point in the history
try copy / deleting folder if moving it doesn't work
  • Loading branch information
nao-pon authored Sep 26, 2024
2 parents ef08b86 + 071b5ab commit 6c3ac22
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion php/elFinderVolumeDriver.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -5329,7 +5329,16 @@ protected function move($src, $dst, $name)
$this->rmTmb($stat); // can not do rmTmb() after _move()
$this->clearcache();

if ($res = $this->convEncOut($this->_move($this->convEncIn($src), $this->convEncIn($dst), $this->convEncIn($name)))) {
$res = $this->convEncOut($this->_move($this->convEncIn($src), $this->convEncIn($dst), $this->convEncIn($name)));
// if moving it didn't work try to copy / delete
if (!$res) {
$res = $this->copy($src, $dst, $name);
if (!$this->remove($src)) {
$res = false;
}
}

if ($res) {
$this->clearstatcache();
if ($stat['mime'] === 'directory') {
$this->updateSubdirsCache($dst, true);
Expand Down

0 comments on commit 6c3ac22

Please sign in to comment.