]> source.dussan.org Git - nextcloud-server.git/commitdiff
First process group shares and then user shares 2110/head
authorVincent Petry <pvince81@owncloud.com>
Wed, 2 Nov 2016 15:19:46 +0000 (16:19 +0100)
committerRoeland Jago Douma <roeland@famdouma.nl>
Mon, 14 Nov 2016 13:39:17 +0000 (14:39 +0100)
This prevents a validation failure where the code checks whether a file
is already shared with another user, but the check disables itself when
the owner is the same. Processing the groups first prevents the check
to kick in too early when the group share still has the old owner while
we try transferring the user share.

apps/files/lib/Command/TransferOwnership.php

index 3b51e4a9e6d5c4352f79c859a080f20902994e04..c8366be32c4c9758914aa3c1bdec6248bb52ea35 100644 (file)
@@ -188,7 +188,7 @@ class TransferOwnership extends Command {
                $output->writeln("Collecting all share information for files and folder of $this->sourceUser ...");
 
                $progress = new ProgressBar($output, count($this->shares));
-               foreach([\OCP\Share::SHARE_TYPE_USER, \OCP\Share::SHARE_TYPE_GROUP, \OCP\Share::SHARE_TYPE_LINK, \OCP\Share::SHARE_TYPE_REMOTE] as $shareType) {
+               foreach([\OCP\Share::SHARE_TYPE_GROUP, \OCP\Share::SHARE_TYPE_USER, \OCP\Share::SHARE_TYPE_LINK, \OCP\Share::SHARE_TYPE_REMOTE] as $shareType) {
                $offset = 0;
                        while (true) {
                                $sharePage = $this->shareManager->getSharesBy($this->sourceUser, $shareType, null, true, 50, $offset);