From: Tim Otten Date: Fri, 11 Sep 2015 05:03:37 +0000 (-0700) Subject: Civi\Core\SettingsManager - Don't try to read settings if there's no DB X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=8c74acc392ac4082cd5c79d940529fcf834b0297;p=civicrm-core.git Civi\Core\SettingsManager - Don't try to read settings if there's no DB --- diff --git a/Civi/Core/SettingsBag.php b/Civi/Core/SettingsBag.php index 6d8810bbf6..e439bbaedd 100644 --- a/Civi/Core/SettingsBag.php +++ b/Civi/Core/SettingsBag.php @@ -91,6 +91,7 @@ class SettingsBag { public function __construct($domainId, $contactId) { $this->domainId = $domainId; $this->contactId = $contactId; + $this->values = array(); $this->filteredValues = array(); $this->combined = NULL; } diff --git a/Civi/Core/SettingsManager.php b/Civi/Core/SettingsManager.php index 6f4930dd34..1c89e50abf 100644 --- a/Civi/Core/SettingsManager.php +++ b/Civi/Core/SettingsManager.php @@ -128,7 +128,10 @@ class SettingsManager { if (!isset($this->bagsByDomain[$domainId])) { $this->bagsByDomain[$domainId] = new SettingsBag($domainId, NULL); - $this->bagsByDomain[$domainId]->loadValues() + if (\CRM_Core_Config::singleton()->dsn) { + $this->bagsByDomain[$domainId]->loadValues(); + } + $this->bagsByDomain[$domainId] ->loadMandatory($this->getMandatory('domain')) ->loadDefaults($this->getDefaults('domain')); } @@ -148,7 +151,10 @@ class SettingsManager { $key = "$domainId:$contactId"; if (!isset($this->bagsByContact[$key])) { $this->bagsByContact[$key] = new SettingsBag($domainId, $contactId); - $this->bagsByContact[$key]->loadValues() + if (\CRM_Core_Config::singleton()->dsn) { + $this->bagsByContact[$key]->loadValues(); + } + $this->bagsByContact[$key] ->loadDefaults($this->getDefaults('contact')) ->loadMandatory($this->getMandatory('contact')); }