From 6e7be6acfdf998eff0b229626dc533572318df80 Mon Sep 17 00:00:00 2001 From: Maxence Lange Date: Tue, 11 Jul 2017 13:21:24 +0200 Subject: upstream Signed-off-by: Maxence Lange --- lib/private/Share20/Manager.php | 2 +- lib/private/Share20/ProviderFactory.php | 16 +++++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) (limited to 'lib/private/Share20') diff --git a/lib/private/Share20/Manager.php b/lib/private/Share20/Manager.php index 7c39733ce2a..798ea937038 100644 --- a/lib/private/Share20/Manager.php +++ b/lib/private/Share20/Manager.php @@ -193,7 +193,7 @@ class Manager implements IManager { throw new \InvalidArgumentException('SharedWith should not be empty'); } } else if ($share->getShareType() === \OCP\Share::SHARE_TYPE_CIRCLE) { - $circle = \OCA\Circles\Api\Circles::detailsCircle($share->getSharedWith()); + $circle = \OCA\Circles\Api\v1\Circles::detailsCircle($share->getSharedWith()); if ($circle === null) { throw new \InvalidArgumentException('SharedWith is not a valid circle'); } diff --git a/lib/private/Share20/ProviderFactory.php b/lib/private/Share20/ProviderFactory.php index ddd8177250b..aedad6a32a7 100644 --- a/lib/private/Share20/ProviderFactory.php +++ b/lib/private/Share20/ProviderFactory.php @@ -51,9 +51,10 @@ class ProviderFactory implements IProviderFactory { private $federatedProvider = null; /** @var ShareByMailProvider */ private $shareByMailProvider; - /** @var \OCA\Circles\ShareByCircleProvider; - * ShareByCircleProvider */ - private $shareByCircleProvider; + /** @var \OCA\Circles\ShareByCircleProvider */ + private $shareByCircleProvider = null; + /** @var bool */ + private $circlesAreNotAvailable = false; /** * IProviderFactory constructor. @@ -179,11 +180,16 @@ class ProviderFactory implements IProviderFactory { */ protected function getShareByCircleProvider() { - $appManager = $this->serverContainer->getAppManager(); - if (!$appManager->isEnabledForUser('circles')) { + if ($this->circlesAreNotAvailable) { return null; } + if (!$this->serverContainer->getAppManager()->isEnabledForUser('circles') || + !class_exists('\OCA\Circles\ShareByCircleProvider') + ) { + $this->circlesAreNotAvailable = true; + return null; + } if ($this->shareByCircleProvider === null) { -- cgit v1.2.3