mirror of
https://github.com/nextcloud/server.git
synced 2026-06-07 15:53:04 -04:00
Merge pull request #46757 from nextcloud/backport/46749/stable28
[stable28] fix: add a try and catch for delete versioning
This commit is contained in:
commit
109bcfd389
1 changed files with 7 additions and 2 deletions
|
|
@ -61,6 +61,7 @@ use OCP\Files\IMimeTypeDetector;
|
|||
use OCP\Files\IRootFolder;
|
||||
use OCP\Files\Node;
|
||||
use OCP\Files\NotFoundException;
|
||||
use OCP\Files\NotPermittedException;
|
||||
use OCP\Files\Search\ISearchBinaryOperator;
|
||||
use OCP\Files\Search\ISearchComparison;
|
||||
use OCP\Files\StorageInvalidException;
|
||||
|
|
@ -626,8 +627,12 @@ class Storage {
|
|||
$versionsMapper->delete($versionEntity);
|
||||
}
|
||||
|
||||
$version->delete();
|
||||
\OC_Hook::emit('\OCP\Versions', 'delete', ['path' => $internalPath, 'trigger' => self::DELETE_TRIGGER_RETENTION_CONSTRAINT]);
|
||||
try {
|
||||
$version->delete();
|
||||
\OC_Hook::emit('\OCP\Versions', 'delete', ['path' => $internalPath, 'trigger' => self::DELETE_TRIGGER_RETENTION_CONSTRAINT]);
|
||||
} catch (NotPermittedException $e) {
|
||||
\OCP\Server::get(LoggerInterface::class)->error("Missing permissions to delete version: {$internalPath}", ['app' => 'files_versions', 'exception' => $e]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue