mirror of
https://github.com/nextcloud/server.git
synced 2026-04-24 07:39:23 -04:00
Merge pull request #53519 from nextcloud/backport/51609/stable30
[stable30] fix(files_versions): only handle path updates when there is path
This commit is contained in:
commit
18bbd08fbe
1 changed files with 12 additions and 4 deletions
|
|
@ -374,11 +374,19 @@ class FileEventsListener implements IEventListener {
|
|||
return;
|
||||
}
|
||||
|
||||
// if we rename a movable mount point, then the versions don't have
|
||||
// to be renamed
|
||||
// if we rename a movable mount point, then the versions don't have to be renamed
|
||||
$oldPath = $this->getPathForNode($source);
|
||||
$newPath = $this->getPathForNode($target);
|
||||
$absOldPath = Filesystem::normalizePath('/' . \OC_User::getUser() . '/files' . $oldPath);
|
||||
if ($oldPath === null || $newPath === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
$user = $this->userSession->getUser()?->getUID();
|
||||
if ($user === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
$absOldPath = Filesystem::normalizePath('/' . $user . '/files' . $oldPath);
|
||||
$manager = Filesystem::getMountManager();
|
||||
$mount = $manager->find($absOldPath);
|
||||
$internalPath = $mount->getInternalPath($absOldPath);
|
||||
|
|
@ -386,7 +394,7 @@ class FileEventsListener implements IEventListener {
|
|||
return;
|
||||
}
|
||||
|
||||
$view = new View(\OC_User::getUser() . '/files');
|
||||
$view = new View($user . '/files');
|
||||
if ($view->file_exists($newPath)) {
|
||||
Storage::store($newPath);
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in a new issue