Merge pull request #42921 from nextcloud/backport/42891/stable28

[stable28] Improve path resolution in files_version hooks
pull/42982/head
Arthur Schiwon 4 months ago committed by GitHub
commit ddb95cef5b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -350,16 +350,24 @@ class FileEventsListener implements IEventListener {
private function getPathForNode(Node $node): ?string {
$user = $this->userSession->getUser()?->getUID();
if ($user) {
return $this->rootFolder
$path = $this->rootFolder
->getUserFolder($user)
->getRelativePath($node->getPath());
if ($path !== null) {
return $path;
}
}
$owner = $node->getOwner()?->getUid();
if ($owner) {
return $this->rootFolder
$path = $this->rootFolder
->getUserFolder($owner)
->getRelativePath($node->getPath());
if ($path !== null) {
return $path;
}
}
return null;

Loading…
Cancel
Save