-
-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[stable26] fix: Make sure that rollback hook is triggered on all version backends #37743
Conversation
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Robin Appelman <robin@icewind.nl>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
$userFolder = $this->rootFolder->getUserFolder($user->getUID()); | ||
$nodes = $userFolder->getById($file->getId()); | ||
$file2 = array_pop($nodes); | ||
$userFolder = $this->rootFolder->getUserFolder($user->getUID()); |
Check notice
Code scanning / Psalm
PossiblyNullReference
$versionEntity->setTimestamp($file2->getMTime()); | ||
$versionEntity->setSize($file2->getSize()); | ||
$versionEntity->setMimetype($this->mimeTypeLoader->getId($file2->getMimetype())); | ||
$versionEntity->setFileId($file->getId()); |
Check notice
Code scanning / Psalm
PossiblyNullArgument
$versionEntity->setMetadata([]); | ||
$this->versionsMapper->insert($versionEntity); | ||
|
||
// Insert entries in the DB for existing versions. | ||
$versionsOnFS = Storage::getVersions($user->getUID(), $userFolder->getRelativePath($file2->getPath())); | ||
$versionsOnFS = Storage::getVersions($user->getUID(), $userFolder->getRelativePath($file->getPath())); |
Check notice
Code scanning / Psalm
PossiblyUndefinedVariable
foreach ($versionsOnFS as $version) { | ||
$versionEntity = new VersionEntity(); | ||
$versionEntity->setFileId($file2->getId()); | ||
$versionEntity->setFileId($file->getId()); |
Check notice
Code scanning / Psalm
PossiblyNullArgument
$nodes = $userFolder->getById($file->getId()); | ||
$file2 = array_pop($nodes); | ||
$userFolder = $this->rootFolder->getUserFolder($user->getUID()); | ||
$nodes = $userFolder->getById($file->getId()); |
Check notice
Code scanning / Psalm
PossiblyNullArgument
backport of #36690