summaryrefslogtreecommitdiffstats
path: root/lib/private/Share20
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/Share20')
-rw-r--r--lib/private/Share20/LegacyHooks.php2
-rw-r--r--lib/private/Share20/Manager.php4
-rw-r--r--lib/private/Share20/ProviderFactory.php18
3 files changed, 17 insertions, 7 deletions
diff --git a/lib/private/Share20/LegacyHooks.php b/lib/private/Share20/LegacyHooks.php
index 728ea78a8a6..09acf6c50e7 100644
--- a/lib/private/Share20/LegacyHooks.php
+++ b/lib/private/Share20/LegacyHooks.php
@@ -71,7 +71,7 @@ class LegacyHooks {
$formatted['deletedShares'] = $formattedDeletedShares;
- \OC_Hook::emit('OCP\Share', 'pre_unshare', $formatted);
+ \OC_Hook::emit('OCP\Share', 'post_unshare', $formatted);
}
private function formatHookParams(IShare $share) {
diff --git a/lib/private/Share20/Manager.php b/lib/private/Share20/Manager.php
index 03c900d36c6..f64ae5d39ee 100644
--- a/lib/private/Share20/Manager.php
+++ b/lib/private/Share20/Manager.php
@@ -168,6 +168,8 @@ class Manager implements IManager {
* @param \OCP\Share\IShare $share
* @throws \InvalidArgumentException
* @throws GenericShareException
+ *
+ * @suppress PhanUndeclaredClassMethod
*/
protected function generalCreateChecks(\OCP\Share\IShare $share) {
if ($share->getShareType() === \OCP\Share::SHARE_TYPE_USER) {
@@ -193,7 +195,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..2b7d0e78c52 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.
@@ -176,14 +177,21 @@ class ProviderFactory implements IProviderFactory {
* Create the circle share provider
*
* @return FederatedShareProvider
+ *
+ * @suppress PhanUndeclaredClassMethod
*/
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) {