X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FExtension%2FManager.php;h=14c7128dd6f2946e35dd6b556ac91602a9327a70;hb=2fa5a830869672f79de1304ff1ea6169ccfcd27f;hp=5b32af8dd0b6c1f6f674f0265ae541b3054d7858;hpb=4e4ccdf54c4565590344092cc77bcf6c34900ceb;p=civicrm-core.git diff --git a/CRM/Extension/Manager.php b/CRM/Extension/Manager.php index 5b32af8dd0..14c7128dd6 100644 --- a/CRM/Extension/Manager.php +++ b/CRM/Extension/Manager.php @@ -382,36 +382,41 @@ class CRM_Extension_Manager { $this->addProcess($keys, 'disable'); foreach ($keys as $key) { - switch ($origStatuses[$key]) { - case self::STATUS_INSTALLED: - $this->addProcess([$key], 'disabling'); - // throws Exception - list ($info, $typeManager) = $this->_getInfoTypeHandler($key); - $typeManager->onPreDisable($info); - $this->_setExtensionActive($info, 0); - $typeManager->onPostDisable($info); - $this->popProcess([$key]); - break; - - case self::STATUS_INSTALLED_MISSING: - // throws Exception - list ($info, $typeManager) = $this->_getMissingInfoTypeHandler($key); - $typeManager->onPreDisable($info); - $this->_setExtensionActive($info, 0); - $typeManager->onPostDisable($info); - break; - - case self::STATUS_DISABLED: - case self::STATUS_DISABLED_MISSING: - case self::STATUS_UNINSTALLED: - // ok, nothing to do - // Remove the 'disable' process as we're not doing that. - $this->popProcess([$key]); - break; - - case self::STATUS_UNKNOWN: - default: - throw new CRM_Extension_Exception("Cannot disable unknown extension: $key"); + if (isset($origStatuses[$key])) { + switch ($origStatuses[$key]) { + case self::STATUS_INSTALLED: + $this->addProcess([$key], 'disabling'); + // throws Exception + list ($info, $typeManager) = $this->_getInfoTypeHandler($key); + $typeManager->onPreDisable($info); + $this->_setExtensionActive($info, 0); + $typeManager->onPostDisable($info); + $this->popProcess([$key]); + break; + + case self::STATUS_INSTALLED_MISSING: + // throws Exception + list ($info, $typeManager) = $this->_getMissingInfoTypeHandler($key); + $typeManager->onPreDisable($info); + $this->_setExtensionActive($info, 0); + $typeManager->onPostDisable($info); + break; + + case self::STATUS_DISABLED: + case self::STATUS_DISABLED_MISSING: + case self::STATUS_UNINSTALLED: + // ok, nothing to do + // Remove the 'disable' process as we're not doing that. + $this->popProcess([$key]); + break; + + case self::STATUS_UNKNOWN: + default: + throw new CRM_Extension_Exception("Cannot disable unknown extension: $key"); + } + } + else { + throw new CRM_Extension_Exception("Cannot disable unknown extension: $key"); } }