aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2025-04-08 07:20:31 +0200
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2025-04-08 13:34:11 +0000
commita9437209b967cb584b9eca535e0846dac9bfdfa1 (patch)
tree30313c53bc186556c2bd184ec3e1c14da8290694
parent98b3a2ea61c1ac1c85db54d73db9d5611f4ab377 (diff)
downloadnextcloud-server-backport/52013/stable31.tar.gz
nextcloud-server-backport/52013/stable31.zip
fix: Handle missing share providers when promoting resharesbackport/52013/stable31
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.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/private/Share20/Manager.php b/lib/private/Share20/Manager.php
index 1749783bc51..037105428f5 100644
--- a/lib/private/Share20/Manager.php
+++ b/lib/private/Share20/Manager.php
@@ -1065,7 +1065,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);