The function was already there but called the legacy version.
So moved the implementation and migrated all usages of it.
Sadly the interface was slightly different so adjusted it to be
compatible with both legacy and the OCP one.
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
The auto expire logic does not take into account the min retention age set by the admin. So versions were eagerly deleted.
Fix https://github.com/nextcloud/server/issues/19791
Signed-off-by: Louis Chemineau <louis@chmn.me>
This prevent restored version of encrypted files from having a wrong reported size. This was blocking download.
Signed-off-by: Louis Chemineau <louis@chmn.me>
The files_lock app may throw ManuallyLockedExceptions
when attempting to revert a file that is currently opened.
This would prevent the user from rolling back a opened file.
Text and Richdocuments handle changes of the file while editing.
Allow reverting files even when they are locked by these apps
and let the apps handle the conflict.
Signed-off-by: Max <max@nextcloud.com>
This avoids being stuck when there is one buggy file version with a
non-integer version. It allows the expiration process to not crash and
continue with the other ones.
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Version on the FS can have no equivalent in the DB if they were created before the version naming feature. This makes sure that we catch the resulting exception and proceed as usual.
Fix https://github.com/nextcloud/server/issues/36541
Signed-off-by: Louis Chemineau <louis@chmn.me>
The remaining deprecations are related to Utils::hooks and I will take a
look at how EventDispatcher works before working on them.
Aside from the deprecations, this patch also does a few minor
improvements around type hinting.
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
If the user has no space and there are no versions, there won't be an
`all` index in the versions entry. Hence this triggers a warning and
becomes `null`, afterwards `count`, `foreach` and friends will happily
throw even more warnings and errors because they don't want to play with
`null`. Thus adding a fallback to an empty array.
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
To continue this formatting madness, here's a tiny patch that adds
unified formatting for control structures like if and loops as well as
classes, their methods and anonymous functions. This basically forces
the constructs to start on the same line. This is not exactly what PSR2
wants, but I think we can have a few exceptions with "our" style. The
starting of braces on the same line is pracrically standard for our
code.
This also removes and empty lines from method/function bodies at the
beginning and end.
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>