Skip to content

Commit 0fdc1cc

Browse files
authored
Merge pull request #52041 from nextcloud/backport/52013/stable29
[stable29] fix: Handle missing share providers when promoting reshares
2 parents 2e04339 + fa9edf3 commit 0fdc1cc

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

lib/private/Share20/Manager.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1215,7 +1215,12 @@ protected function promoteReshares(IShare $share): void {
12151215

12161216
foreach ($userIds as $userId) {
12171217
foreach ($shareTypes as $shareType) {
1218-
$provider = $this->factory->getProviderForType($shareType);
1218+
try {
1219+
$provider = $this->factory->getProviderForType($shareType);
1220+
} catch (ProviderException $e) {
1221+
continue;
1222+
}
1223+
12191224
if ($node instanceof Folder) {
12201225
/* We need to get all shares by this user to get subshares */
12211226
$shares = $provider->getSharesBy($userId, $shareType, null, false, -1, 0);

tests/lib/Share20/ManagerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2273,7 +2273,7 @@ public function testLinkCreateChecksReadOnly() {
22732273

22742274
public function testPathCreateChecksContainsSharedMount() {
22752275
$this->expectException(\InvalidArgumentException::class);
2276-
$this->expectExceptionMessage('You cannot share a folder that contains other shares');
2276+
$this->expectExceptionMessage('Path contains files shared with you');
22772277

22782278
$path = $this->createMock(Folder::class);
22792279
$path->method('getPath')->willReturn('path');

0 commit comments

Comments
 (0)