CrmUi - Fix crmSelect2 to work with ngOptions
[civicrm-core.git] / CRM / Extension / Manager.php
index 444f86ec32b4d44520d0e3fe747a25dbe1745548..800a7b3ce71bd89f7fdeea171fbb5e06654855d1 100644 (file)
@@ -712,9 +712,12 @@ class CRM_Extension_Manager {
    * @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;
     }