From fc4d0a86efef1af4d7ea17547e259cfdd16e82b4 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Tue, 1 Nov 2016 12:15:14 +0100 Subject: Fix merging backend results * Merge share types correctly * Filter share types * Order share types Signed-off-by: Roeland Jago Douma --- apps/dav/lib/Connector/Sabre/SharesPlugin.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'apps/dav/lib') diff --git a/apps/dav/lib/Connector/Sabre/SharesPlugin.php b/apps/dav/lib/Connector/Sabre/SharesPlugin.php index ebb7fefff33..56d76e66184 100644 --- a/apps/dav/lib/Connector/Sabre/SharesPlugin.php +++ b/apps/dav/lib/Connector/Sabre/SharesPlugin.php @@ -148,9 +148,12 @@ class SharesPlugin extends \Sabre\DAV\ServerPlugin { $values = array_map(function (\OCP\Files\Node $node) use ($shares) { /** @var IShare[] $shares */ $shares = (isset($shares[$node->getId()])) ? $shares[$node->getId()] : []; - return array_map(function(IShare $share) { + $types = array_map(function(IShare $share) { return $share->getShareType(); }, $shares); + $types = array_unique($types); + sort($types); + return $types; }, $children); $keys = array_map(function (\OCP\Files\Node $node) { -- cgit v1.2.3