Skip to content

Commit

Permalink
Merge pull request #23716 from totten/5.50-missing-ext
Browse files Browse the repository at this point in the history
(dev/core#3496) Missing extension leads to bootstrap error for "hook_civicrm_entityTypes"
  • Loading branch information
seamuslee001 authored Jun 8, 2022
2 parents 548d8fc + 91e1627 commit 1eb7f2b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions CRM/Extension/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -712,9 +712,12 @@ private function _setExtensionActive(CRM_Extension_Info $info, $isActive) {
* @return CRM_Extension_Info|NULL
*/
public function createInfoFromDB($key) {
$dao = new CRM_Core_DAO_Extension();
$dao->full_name = $key;
if ($dao->find(TRUE)) {
// System hasn't booted - and extension is missing. Need low-tech/no-hook SELECT to learn more about what's missing.
$select = CRM_Utils_SQL_Select::from('civicrm_extension')
->where('full_name = @key', ['key' => $key])
->select('full_name, type, name, label, file');
$dao = $select->execute();
if ($dao->fetch()) {
$info = new CRM_Extension_Info($dao->full_name, $dao->type, $dao->name, $dao->label, $dao->file);
return $info;
}
Expand Down

0 comments on commit 1eb7f2b

Please sign in to comment.