From e181e3862f98697af80c6c8c4d18de769da77ee5 Mon Sep 17 00:00:00 2001 From: monishdeb Date: Thu, 19 Feb 2015 21:07:29 +0530 Subject: [PATCH] use Setting api and resolving conflicts with othere CMS --- install/index.php | 27 ++++++++++++--------------- install/template.html | 2 +- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/install/index.php b/install/index.php index 81d3de0b11..3d4e7c7d2b 100644 --- a/install/index.php +++ b/install/index.php @@ -1350,6 +1350,15 @@ class Installer extends InstallRequirements { $GLOBALS['user'] = $original_user; drupal_save_session(TRUE); + //change the default language to one chosen + if (isset($config['seedLanguage']) && $config['seedLanguage'] != 'en_US') { + civicrm_api3('Setting', 'create', array( + 'domain_id' => 'current_domain', + 'lcMessages' => $config['seedLanguage'], + ) + ); + } + $output .= ''; $output .= ''; $output .= ''; @@ -1417,6 +1426,9 @@ class Installer extends InstallRequirements { $docLinkConfig = "here"; } + $c = CRM_Core_Config::singleton(FALSE); + $c->free(); + $cmsURL = civicrm_cms_base(); $cmsURL .= "wp-admin/admin.php?page=CiviCRM&q=civicrm/admin/configtask&reset=1"; $wpPermissionsURL = "wp-admin/admin.php?page=CiviCRM&q=civicrm/admin/access/wp-permissions&reset=1"; @@ -1430,21 +1442,6 @@ class Installer extends InstallRequirements { echo ''; echo ''; } - - //change the default language to one chosen - if (isset($config['seedLanguage']) && $config['seedLanguage'] != 'en_US') { - $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), - )); - } } return $this->errors; diff --git a/install/template.html b/install/template.html index 76364df0cc..110a30c894 100644 --- a/install/template.html +++ b/install/template.html @@ -51,7 +51,7 @@ window.location = location; } else { - window.location += '?seedLanguage=' + language; + window.location += (location.indexOf('?') < 0 ? '?' : '&') + 'seedLanguage=' + language; } } -- 2.25.1