Louis Chemineau
cec0b310a5
Move module versions management logic out of main logic
...
Signed-off-by: Louis Chemineau <louis@chmn.me>
2023-09-07 15:47:59 +07:00
Julius Härtl
bbb7172220
fix: Also cleanup version metadata if expiring
...
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2023-08-14 19:31:41 +07:00
Louis Chemineau
c3475f4dbb
Fix initialisation of versions in the DB
...
Broken after https://github.com/nextcloud/server/pull/36690
Signed-off-by: Louis Chemineau <louis@chmn.me>
2023-05-25 23:43:40 +07:00
Git'Fellow
d6eb48c436
Check if version has entity before trying to access it
...
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
2023-05-12 16:00:16 +07:00
Git'Fellow
7cd5cbe6e9
Check if version entity is not null before delete
...
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
2023-05-08 14:24:58 +07:00
Max
337fc110ec
fix: catch ManuallyLockedException and use app context
...
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>
2023-05-03 09:52:36 +07:00
Côme Chilliet
60b7d2117e
Merge pull request #37428 from nextcloud/enh/ignore-non-numeric-versions
...
Ignore and log non integer versions
2023-04-20 13:33:58 +07:00
Côme Chilliet
a6b1d990a4
Check for non-numeric versions, not non-integer
...
All versions are string
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-04-05 17:50:45 +07:00
Côme Chilliet
8cc8765089
Ignore and log non integer versions
...
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>
2023-04-05 17:44:14 +07:00
Julius Härtl
cf46bd6915
fix: Make sure that rollback hook is triggered on all version backends
...
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2023-03-13 10:52:35 +07:00
Louis Chemineau
21cd3b0e0d
Handle empty DB while expiring versions
...
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>
2023-02-08 13:56:49 +07:00
Louis Chemineau
ad469969bf
Prevent expiration of named versions
...
Signed-off-by: Louis Chemineau <louis@chmn.me>
2023-01-26 10:12:23 +07:00
Louis Chemineau
6a2f8bc599
Allow to delete a version through DAV
...
Signed-off-by: Louis Chemineau <louis@chmn.me>
2023-01-26 10:12:23 +07:00
Côme Chilliet
53cb5b8d07
Handle badly named version files more gracefully and log information
...
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-10-11 10:10:49 +07:00
Robin Appelman
9587a4a548
use filesystem user instead of file owner for creating version
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-09-09 16:22:40 +07:00
Robin Appelman
7be5788995
always use the default fs owner when storing versions
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-09-06 16:59:48 +07:00
Robin Appelman
d5953e5c33
cache internalpath in versions cleanup
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-04-04 15:40:34 +07:00
Robin Appelman
5f101d910b
use search to find versions to expire
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-08-18 16:52:22 +07:00
Carl Schwan
701b57b81d
Remove allmost all deprecation from the files_version app
...
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>
2021-07-23 10:07:38 +07:00
John Molakvoæ (skjnldsv)
215aef3cbd
Update php licenses
...
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2021-06-04 22:02:41 +07:00
Christoph Wurst
8196420063
Drop \OCP\User
...
Inlines and remaining usages and drops the deprecated public API.
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-05-21 15:00:34 +07:00
dependabot-preview[bot]
eb502c02ff
Bump nextcloud/coding-standard from 0.3.0 to 0.5.0
...
Bumps [nextcloud/coding-standard](https://github.com/nextcloud/coding-standard ) from 0.3.0 to 0.5.0.
- [Release notes](https://github.com/nextcloud/coding-standard/releases )
- [Changelog](https://github.com/nextcloud/coding-standard/blob/master/CHANGELOG.md )
- [Commits](https://github.com/nextcloud/coding-standard/compare/v0.3.0...v0.5.0 )
Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-02-18 13:31:24 +07:00
Robin Appelman
b2fb4d898a
dont stop expiring versions if we cant check if the source file still exists
...
instead continue assuming it still exists
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-02-05 15:06:43 +07:00
Christoph Wurst
d89a75be0b
Update all license headers for Nextcloud 21
...
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-12-16 18:48:22 +07:00
Morris Jobke
6ce05bc7d7
Return all keys in getAllVersions() instead
...
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-10-12 22:17:06 +07:00
Christoph Wurst
02fa3253fe
Fix undefined index and consequential damages in versions code
...
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>
2020-10-12 22:17:06 +07:00
Christoph Wurst
d9015a8c94
Format code to a single space around binary operators
...
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-10-05 20:25:24 +07:00
Christoph Wurst
cb057829f7
Update license headers for 19
...
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-29 11:57:22 +07:00
Liam JACK
b6c76f43a1
Fix #19066 - Array offset error due to empty file versions array
...
Signed-off-by: Liam JACK <liamjack@users.noreply.github.com>
2020-04-12 15:35:17 +07:00
Christoph Wurst
28f8eb5dba
Add visibility to all constants
...
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-10 16:54:27 +07:00
Christoph Wurst
caff1023ea
Format control structures, classes, methods and function
...
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>
2020-04-10 14:19:56 +07:00
Christoph Wurst
14c996d982
Use elseif instead of else if
...
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-10 10:35:09 +07:00
Christoph Wurst
44577e4345
Remove trailing and in between spaces
...
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-09 16:07:47 +07:00
Christoph Wurst
afbd9c4e6e
Unify function spacing to PSR2 recommendation
...
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-09 13:54:22 +07:00
Christoph Wurst
b80ebc9674
Use the short array syntax, everywhere
...
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-03-26 16:34:56 +07:00
Roeland Jago Douma
061b9bb0e7
Merge pull request #18231 from nextcloud/fix/shared_version_restore
...
Fix restoring shared versions
2019-12-09 21:17:24 +07:00
Roeland Jago Douma
78050ec531
Fix restoring shared versions
...
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-12-05 16:50:45 +07:00
Christoph Wurst
5bf3d1bb38
Update license headers
...
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2019-12-05 15:38:45 +07:00
Christoph Wurst
543190f8b3
Do not create Application instances directly
...
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2019-10-11 08:33:09 +07:00
Julius Härtl
e26187c7ff
Make sure we only fetch the file by id for the actual owner
...
Otherwise this will fetch all mounts for the file id which is quite
expensive and causes long saving times in big sharing structures
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2019-08-01 10:10:49 +07:00
Felix Nieuwenhuizen
56457505af
set availableSpace to 0 if userFolder not found
...
Signed-off-by: Felix Nieuwenhuizen <felix@tdlrali.com>
2019-03-02 13:55:11 +07:00
Felix Nieuwenhuizen
0f43d1dfaa
use node API for free space calculation in versions app (same method as trashbin app)
...
Signed-off-by: Felix Nieuwenhuizen <felix@tdlrali.com>
2019-03-02 13:44:47 +07:00
Robin Appelman
4403d771ad
modular versions api
...
Allows apps to register version backends for storage types
The existing versions backend is wrapped in a "legacy" backend.
Signed-off-by: Robin Appelman <robin@icewind.nl>
2018-11-01 00:21:48 +07:00
Roeland Jago Douma
39bb9c06d1
Delete the previews when a version is restored
...
Fixes #9469
When a version of a file is restored the previews are no longer valid.
Thus we should remove them so they are regenerated.
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-05-14 19:58:19 +07:00
Roeland Jago Douma
cd53498256
Use more magic DI in files_versions
...
There is no need to register this. The system can figure out by itself
what it needs to do :)
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-05-11 22:25:07 +07:00
Morris Jobke
dd34cb7540
Less deprecated calls to OCP\Util::writeLog
...
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2018-04-22 20:41:49 +07:00
Morris Jobke
c1e4f9f305
Use type casting instead of *val() method
...
It should be up to 6x faster
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2018-01-26 11:35:42 +07:00
Joas Schilling
a7ad7cb08e
Merge pull request #8053 from nextcloud/simplify-substr
...
Use short for of substr to not need strlen()
2018-01-26 10:25:09 +07:00
Morris Jobke
870fe20acc
Use $var[] = $a instead of array_push - 2x faster
...
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2018-01-25 22:36:03 +07:00
Morris Jobke
e6efa755c9
Use short for of substr to not need strlen()
...
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2018-01-25 22:23:48 +07:00