diff --git a/CRM/Extension/Container/Interface.php b/CRM/Extension/Container/Interface.php index 01c66c249ecd..f55c5687e416 100644 --- a/CRM/Extension/Container/Interface.php +++ b/CRM/Extension/Container/Interface.php @@ -43,6 +43,8 @@ public function getPath($key); * * @param string $key * Fully-qualified extension name. + * + * @throws \CRM_Extension_Exception_MissingException */ public function getResUrl($key); diff --git a/CRM/Extension/Mapper.php b/CRM/Extension/Mapper.php index 43426192cd50..72c6868a8bbf 100644 --- a/CRM/Extension/Mapper.php +++ b/CRM/Extension/Mapper.php @@ -236,9 +236,11 @@ public function keyToBasePath($key) { * * @return string * url for resources in this extension + * + * @throws \CRM_Extension_Exception_MissingException */ public function keyToUrl($key) { - if ($key == 'civicrm') { + if ($key === 'civicrm') { // CRM-12130 Workaround: If the domain's config_backend is NULL at the start of the request, // then the Mapper is wrongly constructed with an empty value for $this->civicrmUrl. if (empty($this->civicrmUrl)) { @@ -339,6 +341,8 @@ public function getActiveModuleFiles($fresh = FALSE) { * * @return array * (string $extKey => string $baseUrl) + * + * @throws \CRM_Extension_Exception_MissingException */ public function getActiveModuleUrls() { // TODO optimization/caching @@ -347,7 +351,12 @@ public function getActiveModuleUrls() { foreach ($this->getModules() as $module) { /** @var $module CRM_Core_Module */ if ($module->is_active) { - $urls[$module->name] = $this->keyToUrl($module->name); + try { + $urls[$module->name] = $this->keyToUrl($module->name); + } + catch (CRM_Extension_Exception_MissingException $e) { + CRM_Core_Session::setStatus(ts('An enabled extension is missing from the extensions directory') . ':' . $module->name); + } } } return $urls;