Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Adjust null group handing + tests
  • Loading branch information
Vincent Petry committed Jan 17, 2017
commit 56ca62ae46914d8ea1e9b27b52af2450aa6cfc60
4 changes: 4 additions & 0 deletions apps/files_sharing/lib/MountProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,10 @@ private function buildSuperShares(array $allShares, \OCP\IUser $user) {
// such issue can usually happen when dealing with
// null groups which usually appear with group backend
// caching inconsistencies
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather log something. It will be easier to debug possible errors or to know what is being ignored.

\OC::$server->getLogger()->debug(
'Could not adjust share target for share ' . $share->getId() . ' to make it consistent: ' . $e->getMessage(),
['app' => 'files_sharing']
);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion apps/files_sharing/tests/API/Share20OCSTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ public function testCanAccessShare() {
// null group
$share = $this->getMock('OCP\Share\IShare');
$share->method('getShareType')->willReturn(\OCP\Share::SHARE_TYPE_GROUP);
$share->method('getSharedWith')->willReturn('group2');
$share->method('getSharedWith')->willReturn('groupnull');
$this->assertFalse($this->invokePrivate($this->ocs, 'canAccessShare', [$share]));

$share = $this->getMock('OCP\Share\IShare');
Expand Down
4 changes: 2 additions & 2 deletions tests/lib/Share20/ManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1153,7 +1153,7 @@ public function testUserCreateChecksIdenticalPathSharedViaDeletedGroup() {
->with($path)
->willReturn([$share2]);

$this->invokePrivate($this->manager, 'userCreateChecks', [$share]);
$this->assertNull($this->invokePrivate($this->manager, 'userCreateChecks', [$share]));
}

public function testUserCreateChecksIdenticalPathNotSharedWithUser() {
Expand Down Expand Up @@ -1253,7 +1253,7 @@ public function testGroupCreateChecksShareWithGroupMembersOnlyNullGroup() {
['core', 'shareapi_allow_group_sharing', 'yes', 'yes'],
]));

$this->invokePrivate($this->manager, 'groupCreateChecks', [$share]);
$this->assertNull($this->invokePrivate($this->manager, 'groupCreateChecks', [$share]));
}

public function testGroupCreateChecksShareWithGroupMembersOnlyInGroup() {
Expand Down