diff options
author | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2025-04-08 07:20:31 +0200 |
---|---|---|
committer | backportbot[bot] <backportbot[bot]@users.noreply.github.com> | 2025-04-08 13:35:15 +0000 |
commit | 03f39ee8dab37ae273c4479282e8f8d7c281a4e1 (patch) | |
tree | 12bb7a7b764fd4364f6baf741cba73004c510517 | |
parent | fa65153071f1ff85e177ff216caa576e64e42614 (diff) | |
download | nextcloud-server-backport/52013/stable28.tar.gz nextcloud-server-backport/52013/stable28.zip |
fix: Handle missing share providers when promoting resharesbackport/52013/stable28
The provider for mail shares is not available when the "sharebymail" app
is disabled, and in that case a "ProviderException" is thrown when
trying to get it.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
-rw-r--r-- | lib/private/Share20/Manager.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/private/Share20/Manager.php b/lib/private/Share20/Manager.php index 045be060e69..60b00b5ec9a 100644 --- a/lib/private/Share20/Manager.php +++ b/lib/private/Share20/Manager.php @@ -1207,7 +1207,12 @@ class Manager implements IManager { foreach ($userIds as $userId) { foreach ($shareTypes as $shareType) { - $provider = $this->factory->getProviderForType($shareType); + try { + $provider = $this->factory->getProviderForType($shareType); + } catch (ProviderException $e) { + continue; + } + if ($node instanceof Folder) { /* We need to get all shares by this user to get subshares */ $shares = $provider->getSharesBy($userId, $shareType, null, false, -1, 0); |