mirror of
https://github.com/nextcloud/server.git
synced 2026-04-15 22:11:17 -04:00
fix: Delete ghost versions of non-existing files
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
This commit is contained in:
parent
d56b1c28ba
commit
ffeef99abc
1 changed files with 4 additions and 1 deletions
|
|
@ -592,14 +592,17 @@ class Storage {
|
|||
throw new DoesNotExistException('Could not find relative path of (' . $info->getPath() . ')');
|
||||
}
|
||||
|
||||
$node = $userFolder->get(substr($path, 0, -strlen('.v'.$version)));
|
||||
try {
|
||||
$node = $userFolder->get(substr($path, 0, -strlen('.v'.$version)));
|
||||
$versionEntity = $versionsMapper->findVersionForFileId($node->getId(), $version);
|
||||
$versionEntities[$info->getId()] = $versionEntity;
|
||||
|
||||
if ($versionEntity->getLabel() !== '') {
|
||||
return false;
|
||||
}
|
||||
} catch (NotFoundException $e) {
|
||||
// Original node not found, delete the version
|
||||
return true;
|
||||
} catch (DoesNotExistException $ex) {
|
||||
// Version on FS can have no equivalent in the DB if they were created before the version naming feature.
|
||||
// So we ignore DoesNotExistException.
|
||||
|
|
|
|||
Loading…
Reference in a new issue