Merge pull request #5484 from nextcloud/fix-if-circles-is-deleted
Check if Circles is still here
This commit is contained in:
commit
48351b4778
|
@ -450,7 +450,7 @@ class ShareAPIController extends OCSController {
|
||||||
}
|
}
|
||||||
$share->setSharedWith($shareWith);
|
$share->setSharedWith($shareWith);
|
||||||
} else if ($shareType === \OCP\Share::SHARE_TYPE_CIRCLE) {
|
} else if ($shareType === \OCP\Share::SHARE_TYPE_CIRCLE) {
|
||||||
if (!\OCP\App::isEnabled('circles')) {
|
if (!\OC::$server->getAppManager()->isEnabledForUser('circles') || !class_exists('\OCA\Circles\ShareByCircleProvider')) {
|
||||||
throw new OCSNotFoundException($this->l->t('You cannot share to a Circle if the app is not enabled'));
|
throw new OCSNotFoundException($this->l->t('You cannot share to a Circle if the app is not enabled'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -472,7 +472,7 @@ class ShareesAPIController extends OCSController {
|
||||||
$shareTypes[] = Share::SHARE_TYPE_EMAIL;
|
$shareTypes[] = Share::SHARE_TYPE_EMAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (\OCP\App::isEnabled('circles')) {
|
if (\OC::$server->getAppManager()->isEnabledForUser('circles') && class_exists('\OCA\Circles\ShareByCircleProvider')) {
|
||||||
$shareTypes[] = Share::SHARE_TYPE_CIRCLE;
|
$shareTypes[] = Share::SHARE_TYPE_CIRCLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -51,9 +51,10 @@ class ProviderFactory implements IProviderFactory {
|
||||||
private $federatedProvider = null;
|
private $federatedProvider = null;
|
||||||
/** @var ShareByMailProvider */
|
/** @var ShareByMailProvider */
|
||||||
private $shareByMailProvider;
|
private $shareByMailProvider;
|
||||||
/** @var \OCA\Circles\ShareByCircleProvider;
|
/** @var \OCA\Circles\ShareByCircleProvider */
|
||||||
* ShareByCircleProvider */
|
private $shareByCircleProvider = null;
|
||||||
private $shareByCircleProvider;
|
/** @var bool */
|
||||||
|
private $circlesAreNotAvailable = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* IProviderFactory constructor.
|
* IProviderFactory constructor.
|
||||||
|
@ -179,11 +180,16 @@ class ProviderFactory implements IProviderFactory {
|
||||||
*/
|
*/
|
||||||
protected function getShareByCircleProvider() {
|
protected function getShareByCircleProvider() {
|
||||||
|
|
||||||
$appManager = $this->serverContainer->getAppManager();
|
if ($this->circlesAreNotAvailable) {
|
||||||
if (!$appManager->isEnabledForUser('circles')) {
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!$this->serverContainer->getAppManager()->isEnabledForUser('circles') ||
|
||||||
|
!class_exists('\OCA\Circles\ShareByCircleProvider')
|
||||||
|
) {
|
||||||
|
$this->circlesAreNotAvailable = true;
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
if ($this->shareByCircleProvider === null) {
|
if ($this->shareByCircleProvider === null) {
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue