From: monishdeb Date: Thu, 19 Feb 2015 11:37:15 +0000 (+0530) Subject: use of API instead of DAO instance X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=4690062bb2cb9f4a21e2349c25ee5030e641022d;p=civicrm-core.git use of API instead of DAO instance --- diff --git a/install/index.php b/install/index.php index 2189e15908..81d3de0b11 100644 --- a/install/index.php +++ b/install/index.php @@ -1433,13 +1433,17 @@ class Installer extends InstallRequirements { //change the default language to one chosen if (isset($config['seedLanguage']) && $config['seedLanguage'] != 'en_US') { - $domain = new CRM_Core_DAO_Domain(); - $domain->id = CRM_Core_Config::domainID(); - $domain->find(TRUE); - $configSettings = unserialize($domain->config_backend); - $configSettings['lcMessages'] = $config['seedLanguage']; - $domain->config_backend = serialize($configSettings); - $domain->save(); + $domainID = CRM_Core_Config::domainID(); + $configBackend = civicrm_api3('Domain', 'getvalue', array('id' => $domainID, 'return'=> 'config_backend')); + $configBackend = unserialize($config_backend); + + //TODO: Scope to set default attributes like for now e.g. Default Launguage + $configBackend['lcMessages'] = $config['seedLanguage']; + $result = civicrm_api3('Domain', 'setvalue', array( + 'id' => $domainID, + 'field' => 'config_backend', + 'value' => serialize($configBackend), + )); } }