From: Tim Otten Date: Thu, 27 Aug 2015 23:03:54 +0000 (-0700) Subject: CRM-16373 - Simplify loading of enableComponents X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=f4fb2d791370146dd204f9b6d9042b28642a7e00;p=civicrm-core.git CRM-16373 - Simplify loading of enableComponents --- diff --git a/CRM/Admin/Form/Setting.php b/CRM/Admin/Form/Setting.php index 27fb069d19..7e570dcd10 100644 --- a/CRM/Admin/Form/Setting.php +++ b/CRM/Admin/Form/Setting.php @@ -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; diff --git a/CRM/Core/BAO/ConfigSetting.php b/CRM/Core/BAO/ConfigSetting.php index 01a5010848..4868c5ce82 100644 --- a/CRM/Core/BAO/ConfigSetting.php +++ b/CRM/Core/BAO/ConfigSetting.php @@ -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; - } - } } /** diff --git a/CRM/Core/Config.php b/CRM/Core/Config.php index 86e7215753..624e0e9afe 100644 --- a/CRM/Core/Config.php +++ b/CRM/Core/Config.php @@ -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();