From a0988281eed23da87ad2d39d8bce5a3935bd3dc9 Mon Sep 17 00:00:00 2001
From: Roeland Jago Douma <roeland@famdouma.nl>
Date: Fri, 22 Jan 2021 13:52:43 +0100
Subject: [PATCH] Do not obtain userFolder of a federated user

Federated shares are somewhat special. So we can't move the files from
the main user and we should try to get it from the intialized root
already.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
---
 apps/files_trashbin/lib/Storage.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/apps/files_trashbin/lib/Storage.php b/apps/files_trashbin/lib/Storage.php
index 7ae96f1b6b7..936e6d64675 100644
--- a/apps/files_trashbin/lib/Storage.php
+++ b/apps/files_trashbin/lib/Storage.php
@@ -135,7 +135,7 @@ class Storage extends Wrapper {
 		// check if there is a app which want to disable the trash bin for this file
 		$fileId = $this->storage->getCache()->getId($path);
 		$owner = $this->storage->getOwner($path);
-		if ($owner === false) {
+		if ($owner === false || $this->storage->instanceOfStorage(\OCA\Files_Sharing\External\Storage::class)) {
 			$nodes = $this->rootFolder->getById($fileId);
 		} else {
 			$nodes = $this->rootFolder->getUserFolder($owner)->getById($fileId);
-- 
GitLab