Merge pull request #15321 from yashodha/dev_1065
[civicrm-core.git] / CRM / Extension / Mapper.php
index 358d3a9103233a37b5d8494f561de53f0298efb7..fd828e4fe771e54a8a85776317fdf969e521ba48 100644 (file)
@@ -275,9 +275,9 @@ class CRM_Extension_Mapper {
    *   array(array('prefix' => $, 'file' => $))
    */
   public function getActiveModuleFiles($fresh = FALSE) {
-    $config = CRM_Core_Config::singleton();
-    if ($config->isUpgradeMode() || !defined('CIVICRM_DSN')) {
-      return []; // hmm, ok
+    if (!defined('CIVICRM_DSN')) {
+      // hmm, ok
+      return [];
     }
 
     $moduleExtensions = NULL;
@@ -286,6 +286,8 @@ class CRM_Extension_Mapper {
     }
 
     if (!is_array($moduleExtensions)) {
+      $compat = CRM_Extension_System::getCompatibilityInfo();
+
       // Check canonical module list
       $moduleExtensions = [];
       $sql = '
@@ -296,6 +298,9 @@ class CRM_Extension_Mapper {
       ';
       $dao = CRM_Core_DAO::executeQuery($sql);
       while ($dao->fetch()) {
+        if (!empty($compat[$dao->full_name]['force-uninstall'])) {
+          continue;
+        }
         try {
           $moduleExtensions[] = [
             'prefix' => $dao->file,