From 071b5ab33ce3583a1f57fa140a6f0b4e3ef12550 Mon Sep 17 00:00:00 2001 From: terrafrost Date: Tue, 21 May 2024 08:52:23 -0500 Subject: [PATCH] try copy / deleting folder if moving it doesn't work --- php/elFinderVolumeDriver.class.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/php/elFinderVolumeDriver.class.php b/php/elFinderVolumeDriver.class.php index fbd3571e7..2d2955827 100644 --- a/php/elFinderVolumeDriver.class.php +++ b/php/elFinderVolumeDriver.class.php @@ -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);