]> source.dussan.org Git - nextcloud-server.git/commitdiff
Unify share type sorting when getting shares of a file or with subfiles
authorDaniel Calviño Sánchez <danxuliu@gmail.com>
Fri, 25 Oct 2019 08:20:32 +0000 (10:20 +0200)
committerDaniel Calviño Sánchez <danxuliu@gmail.com>
Fri, 25 Oct 2019 19:39:49 +0000 (21:39 +0200)
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
apps/files_sharing/lib/Controller/ShareAPIController.php
apps/files_sharing/tests/Controller/ShareAPIControllerTest.php

index 04eb8225fbce9ca27b603cf1102b76d57bd92bdd..8b5ad12ae52b13e5a0d02d3252707b0e89f9e29f 100644 (file)
@@ -629,10 +629,10 @@ class ShareAPIController extends OCSController {
                        $shares = array_merge($shares, $this->shareManager->getSharesBy($this->currentUser, Share::SHARE_TYPE_GROUP, $node, true, -1, 0));
                        $shares = array_merge($shares, $this->shareManager->getSharesBy($this->currentUser, Share::SHARE_TYPE_LINK, $node, true, -1, 0));
                        $shares = array_merge($shares, $this->shareManager->getSharesBy($this->currentUser, Share::SHARE_TYPE_EMAIL, $node, true, -1, 0));
+                       $shares = array_merge($shares, $this->shareManager->getSharesBy($this->currentUser, Share::SHARE_TYPE_ROOM, $node, true, -1, 0));
                        if ($this->shareManager->outgoingServer2ServerSharesAllowed()) {
                                $shares = array_merge($shares, $this->shareManager->getSharesBy($this->currentUser, Share::SHARE_TYPE_REMOTE, $node, true, -1, 0));
                        }
-                       $shares = array_merge($shares, $this->shareManager->getSharesBy($this->currentUser, Share::SHARE_TYPE_ROOM, $node, true, -1, 0));
                }
 
                $formatted = $miniFormatted = [];
index fd6aed09a9fd9e2b854eaea39379d32b3cafa602..3e0dc29fe95929e8525f39df3bfe37bee9900b61 100644 (file)
@@ -1288,8 +1288,8 @@ class ShareAPIControllerTest extends TestCase {
                                        $file1GroupShareOwnerExpected,
                                        $file1LinkShareOwnerExpected,
                                        $file1EmailShareOwnerExpected,
-                                       $file1RemoteShareOwnerExpected,
                                        $file1RoomShareOwnerExpected,
+                                       $file1RemoteShareOwnerExpected,
                                ]
                        ],
                ];