Skip to content

Commit

Permalink
Merge pull request #11491 from mlutfy/crm21627
Browse files Browse the repository at this point in the history
CRM-21627: makeMultilingual: update dbLocale to avoid fatal if lcMessages was not set
  • Loading branch information
monishdeb authored Jan 10, 2018
2 parents 861f3aa + ca62457 commit 9028c91
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CRM/Core/I18n/Schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ public static function makeMultilingual($locale) {
// update civicrm_domain.locales
$domain->locales = $locale;
$domain->save();

// CRM-21627 Updates the $dbLocale
CRM_Core_BAO_ConfigSetting::applyLocale(Civi::settings($domain->id), $domain->locales);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions tests/phpunit/CRM/Logging/LoggingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ public function testMultilingualAlterSchemaLogging() {
$value = CRM_Core_DAO::singleValueQuery("SELECT id FROM log_civicrm_contact LIMIT 1", array(), FALSE, FALSE);
$this->assertNotNull($value, 'Logging not enabled successfully');
$logging->disableLogging();
CRM_Core_DAO::executeQuery("ALTER TABLE `civicrm_option_value` ADD COLUMN `logging_test` INT DEFAULT NULL", array(), FALSE, NULL, FALSE, TRUE);
CRM_Core_DAO::executeQuery("ALTER TABLE `civicrm_option_value` ADD COLUMN `logging_test` INT DEFAULT NULL", array(), FALSE, NULL, FALSE, FALSE);
CRM_Core_I18n_Schema::rebuildMultilingualSchema(array('en_US'));
$logging->enableLogging();
$query = CRM_Core_DAO::executeQuery("SHOW CREATE TABLE `log_civicrm_option_value`", array(), TRUE, NULL, FALSE, FALSE);
$query->fetch();
$create = explode("\n", $query->Create_Table);
CRM_Core_DAO::executeQuery("ALTER TABLE `civicrm_option_value` DROP COLUMN `logging_test`", array(), FALSE, NULL, FALSE, TRUE);
CRM_Core_DAO::executeQuery("ALTER TABLE `civicrm_option_value` DROP COLUMN `logging_test`", array(), FALSE, NULL, FALSE, FALSE);
$this->assertTrue(in_array(" `logging_test` int(11) DEFAULT NULL", $create));
$logging->disableLogging();
}
Expand Down

0 comments on commit 9028c91

Please sign in to comment.