* fixes#20425
* this removes the argument trashbin size from the expire job - it is now
calculated in the expire job
* the queue now detects properly that the job is already queue and doesn't
add it again
Currently the `getPath` methods returned `NULL` in case when a file with the specified ID does not exist. This however mandates that developers are checking for the `NULL` case and if they do not the door for bugs with all kind of impact is widely opened.
This is especially harmful if used in context with Views where the final result is limited based on the result of `getPath`, if `getPath` returns `NULL` PHP type juggles this to an empty string resulting in all possible kind of bugs.
While one could argue that this is a misusage of the API the fact is that it is very often misused and an exception will trigger an immediate stop of execution as well as log this behaviour and show a pretty error page.
I also adjusted some usages where I believe that we need to catch these errors, in most cases this is though simply an error that should hard-fail.
The original owner could not be resolved because the original file was
already deleted, so no versions were retained.
This fix passes the owner and path to retainVersions() since it was
already resolved before the file deletion. This reactivates the versions
logic and creates a copy of the versions in each trashbin.
When restoring a file, a unique name needs to be generated if a file
with the same name already exists.
Also fixed the restore() method to return false if the file to restore
does not exist.
Added unit tests to cover restore cases.
This makes sure that folders are moved to trash when deleted with
rmdir() instead of unlink().
This happens for example when deleting a folder over WebDAV.
The web UI uses unlink() so it wasn't affected.
After a failed rename, the post_rename hook is not called.
This quickfix makes sure the trashbin storage logic is reenabled
also after a failed rename.