aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2025-04-08 07:20:31 +0200
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2025-04-08 07:20:31 +0200
commit10019955f1c22e7114847a536241fa391f2a8674 (patch)
treec9eb6b15b45697d3e39978a15565ef503271b4eb
parent815d98547031290c5f19b264744049b2e7963087 (diff)
downloadnextcloud-server-10019955f1c22e7114847a536241fa391f2a8674.tar.gz
nextcloud-server-10019955f1c22e7114847a536241fa391f2a8674.zip
fix: Handle missing share providers when promoting reshareshandle-missing-share-providers-when-promoting-reshares
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);