-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
fix: Make sure that rollback hook is triggered on all version backends #36690
Conversation
Will have a look into the failing tests... |
6f7fe63
to
e6317dd
Compare
$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
771cd47
to
5f478a9
Compare
$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
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>
5f478a9
to
f00f424
Compare
Thanks a lot @icewind1991 💙 |
@icewind1991 Kindly also asking for a review :) |
Hello, Is there any updates on this. We created a ticket with onlyoffice regarding this since we're enterprise user with them. Looks like there was a sugestion fix via nextcloud/groupfolders#2260 Can Nextcloud Devs look into this as our users with onlyofice are effected by this. Thank you! |
@AndyXheli Please make sure to reach out through support if this is affecting enterprise customers ;) |
Sorry accidentally cleared the review @artonge Nothing changed since back then. |
/backport to stable26 |
/backport to stable25 |
/backport to stable24 |
The backport to stable26 failed. Please do this backport manually. # Switch to the target branch and update it
git checkout stable26
git pull origin/stable26
# Create the new backport branch
git checkout -b fix/foo-stable26
# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts. Resolve them.
git cherry-pick abc123
# Push the cherry pick commit to the remote repository and open a pull request
git push origin fix/foo-stable26 More info at https://docs.nextcloud.com/server/latest/developer_manual/getting_started/development_process.html#manual-backport |
The backport to stable25 failed. Please do this backport manually. # Switch to the target branch and update it
git checkout stable25
git pull origin/stable25
# Create the new backport branch
git checkout -b fix/foo-stable25
# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts. Resolve them.
git cherry-pick abc123
# Push the cherry pick commit to the remote repository and open a pull request
git push origin fix/foo-stable25 More info at https://docs.nextcloud.com/server/latest/developer_manual/getting_started/development_process.html#manual-backport |
The backport to stable24 failed. Please do this backport manually. # Switch to the target branch and update it
git checkout stable24
git pull origin/stable24
# Create the new backport branch
git checkout -b fix/foo-stable24
# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts. Resolve them.
git cherry-pick abc123
# Push the cherry pick commit to the remote repository and open a pull request
git push origin fix/foo-stable24 More info at https://docs.nextcloud.com/server/latest/developer_manual/getting_started/development_process.html#manual-backport |
/backport to stable26 |
/backport to stable25 |
Broken after #36690 Signed-off-by: Louis Chemineau <louis@chmn.me>
Broken after #36690 Signed-off-by: Louis Chemineau <louis@chmn.me>
Broken after #36690 Signed-off-by: Louis Chemineau <louis@chmn.me>
Broken after #36690 Signed-off-by: Louis Chemineau <louis@chmn.me>
Broken after #36690 Signed-off-by: Louis Chemineau <louis@chmn.me>
Broken after #36690 Signed-off-by: Louis Chemineau <louis@chmn.me>
Summary
Alternative to nextcloud/groupfolders#2260 to apply to any version backend.
Checklist