Commit b597d0b1 authored by lobo's avatar lobo

CRM-12121

parent 8d33e12b
...@@ -41,7 +41,8 @@ ...@@ -41,7 +41,8 @@
class CRM_Core_BAO_ConfigSetting { class CRM_Core_BAO_ConfigSetting {
/** /**
* Function to create civicrm settings. This is the same as add but it clears the cache and reloads the config object * Function to create civicrm settings. This is the same as add but it clears the cache and
* reloads the config object
* *
* @params array $params associated array of civicrm variables * @params array $params associated array of civicrm variables
* *
...@@ -69,11 +70,16 @@ class CRM_Core_BAO_ConfigSetting { ...@@ -69,11 +70,16 @@ class CRM_Core_BAO_ConfigSetting {
// also set a template url so js files can use this // also set a template url so js files can use this
// CRM-6194 // CRM-6194
$params['civiRelativeURL'] = CRM_Utils_System::url('CIVI_BASE_TEMPLATE'); $params['civiRelativeURL'] = CRM_Utils_System::url('CIVI_BASE_TEMPLATE');
$params['civiRelativeURL'] = str_replace('CIVI_BASE_TEMPLATE', $params['civiRelativeURL'] =
'', str_replace(
'CIVI_BASE_TEMPLATE',
'',
$params['civiRelativeURL'] $params['civiRelativeURL']
); );
// also add the version number for use by template / js etc
$params['civiVersion'] = CRM_Utils_System::version();
$domain = new CRM_Core_DAO_Domain(); $domain = new CRM_Core_DAO_Domain();
$domain->id = CRM_Core_Config::domainID(); $domain->id = CRM_Core_Config::domainID();
$domain->find(TRUE); $domain->find(TRUE);
......
...@@ -524,8 +524,12 @@ class CRM_Core_BAO_Setting extends CRM_Core_DAO_Setting { ...@@ -524,8 +524,12 @@ class CRM_Core_BAO_Setting extends CRM_Core_DAO_Setting {
* - description * - description
* - help_text * - help_text
*/ */
static function getSettingSpecification($componentID = null, $filters = array(), $domainID = null, $profile = null) { static function getSettingSpecification(
$componentID = null,
$filters = array(),
$domainID = null,
$profile = null
) {
$cacheString = 'settingsMetadata_' . $domainID . '_' . $profile; $cacheString = 'settingsMetadata_' . $domainID . '_' . $profile;
foreach ($filters as $filterField => $filterString) { foreach ($filters as $filterField => $filterString) {
$cacheString .= "_{$filterField}_{$filterString}"; $cacheString .= "_{$filterField}_{$filterString}";
......
...@@ -323,7 +323,9 @@ class CRM_Core_Config extends CRM_Core_Config_Variables { ...@@ -323,7 +323,9 @@ class CRM_Core_Config extends CRM_Core_Config_Variables {
// also make sure we create the config directory within this directory // also make sure we create the config directory within this directory
// the below statement will create both the templates directory and the config and log directory // the below statement will create both the templates directory and the config and log directory
$this->configAndLogDir = CRM_Utils_File::baseFilePath($this->templateCompileDir) . 'ConfigAndLog' . DIRECTORY_SEPARATOR; $this->configAndLogDir =
CRM_Utils_File::baseFilePath($this->templateCompileDir) .
'ConfigAndLog' . DIRECTORY_SEPARATOR;
CRM_Utils_File::createDir($this->configAndLogDir); CRM_Utils_File::createDir($this->configAndLogDir);
// we're automatically prefixing compiled templates directories with country/language code // we're automatically prefixing compiled templates directories with country/language code
......
...@@ -614,6 +614,12 @@ SET version = '$version' ...@@ -614,6 +614,12 @@ SET version = '$version'
// Seems extraneous in context, but we'll preserve old behavior // Seems extraneous in context, but we'll preserve old behavior
$upgrade->setVersion($latestVer); $upgrade->setVersion($latestVer);
// lets rebuild the config array in case we've made a few changes in the
// code base
// this also helps us always store the latest version of civi in the DB
$params = array();
CRM_Core_BAO_ConfigSetting::add($params);
// cleanup caches CRM-8739 // cleanup caches CRM-8739
$config = CRM_Core_Config::singleton(); $config = CRM_Core_Config::singleton();
$config->cleanupCaches(1, FALSE); $config->cleanupCaches(1, FALSE);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment