CRM-16373 - Simplify loading of enableComponents
authorTim Otten <totten@civicrm.org>
Thu, 27 Aug 2015 23:03:54 +0000 (16:03 -0700)
committerTim Otten <totten@civicrm.org>
Thu, 17 Sep 2015 22:45:02 +0000 (15:45 -0700)
CRM/Admin/Form/Setting.php
CRM/Core/BAO/ConfigSetting.php
CRM/Core/Config.php

index 27fb069d19ab0d70b2fd323be9388edd22513801..7e570dcd1068e28e94a390b54859158bb5404986 100644 (file)
@@ -101,6 +101,7 @@ class CRM_Admin_Form_Setting extends CRM_Core_Form {
 
       $this->_defaults['enableSSL'] = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'enableSSL');
       $this->_defaults['verifySSL'] = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'verifySSL');
+      $this->_defaults['enableComponents'] = Civi::settings()->get('enable_components');
     }
 
     return $this->_defaults;
index 01a5010848fde4fd1dd83d01adbaf57eeb6e2d67..4868c5ce82c3a0563a494a1844399e9555ae4df9 100644 (file)
@@ -310,15 +310,6 @@ class CRM_Core_BAO_ConfigSetting {
         mb_internal_encoding('UTF-8');
       }
     }
-
-    // dont add if its empty
-    if (!empty($defaults)) {
-      // Pickup enabled-components from settings table if found.
-      $enableComponents = Civi::settings()->get('enable_components');
-      if (!empty($enableComponents)) {
-        $defaults['enableComponents'] = $enableComponents;
-      }
-    }
   }
 
   /**
index 86e721575392b2aacf37c574607fce9e93fc7bdc..624e0e9afee436a2403da0328b2a5161849bad6b 100644 (file)
@@ -288,6 +288,8 @@ class CRM_Core_Config extends CRM_Core_Config_Variables {
       $this->$key = $value;
     }
 
+    $this->enableComponents = Civi::settings()->get('enable_components');
+
     $this->customFileUploadDir = CRM_Core_Config_Defaults::getCustomFileUploadDir();
     $this->customPHPPathDir = CRM_Core_Config_Defaults::getCustomPhpPathDir();
     $this->customTemplateDir = CRM_Core_Config_Defaults::getCustomTemplateDir();