fix: fallback from guessing the owner from path in versioning

Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
Robin Appelman 2024-02-16 11:55:06 +01:00 committed by backportbot[bot]
parent 92e43540ba
commit 3263de77f2

View file

@ -361,6 +361,16 @@ class FileEventsListener implements IEventListener {
}
$owner = $node->getOwner()?->getUid();
// If no owner, extract it from the path.
// e.g. /user/files/foobar.txt
if (!$owner) {
$parts = explode('/', $node->getPath(), 4);
if (count($parts) === 4) {
$owner = $parts[1];
}
}
if ($owner) {
$path = $this->rootFolder
->getUserFolder($owner)