From 5b6ed484affb8741db61c134de37a8c985cfa1bf Mon Sep 17 00:00:00 2001 From: atif-shaikh Date: Fri, 5 Dec 2014 15:21:40 +0530 Subject: [PATCH] CRM-11993 Fixes - Few bugs on switching language https://issues.civicrm.org/jira/browse/CRM-11993 --- CRM/Core/BAO/ConfigSetting.php | 7 ++++-- CRM/Core/Block.php | 6 ----- templates/CRM/Block/LangSwitch.tpl | 2 +- templates/CRM/common/langSwitch.tpl | 36 ----------------------------- 4 files changed, 6 insertions(+), 45 deletions(-) delete mode 100644 templates/CRM/common/langSwitch.tpl diff --git a/CRM/Core/BAO/ConfigSetting.php b/CRM/Core/BAO/ConfigSetting.php index bcfd3014fd..12e3a81c33 100644 --- a/CRM/Core/BAO/ConfigSetting.php +++ b/CRM/Core/BAO/ConfigSetting.php @@ -318,8 +318,11 @@ class CRM_Core_BAO_ConfigSetting { } } - // if a single-lang site or the above didn't yield a result, use default - $lcMessages = CRM_Utils_Array::value( 'lcMessages', $defaults ); + if (empty($lcMessages)) { + // if a single-lang site, use default + //CRM-11993 + $lcMessages = CRM_Utils_Array::value('lcMessages', $defaults); + } // set suffix for table names - use views if more than one language $dbLocale = $multiLang ? "_{$lcMessages}" : ''; diff --git a/CRM/Core/Block.php b/CRM/Core/Block.php index b6f75ebaaf..a865fda6df 100644 --- a/CRM/Core/Block.php +++ b/CRM/Core/Block.php @@ -312,12 +312,6 @@ class CRM_Core_Block { ); break; - case self::LANGSWITCH: - // gives the currentPath without trailing empty lcMessages to be completed - $values = array('currentPath' => CRM_Utils_System::currentPath() . '?' . CRM_Utils_System::getLinksUrl('lcMessages', TRUE, FALSE, FALSE)); - self::setProperty(self::LANGSWITCH, 'templateValues', $values); - break; - case self::FULLTEXT_SEARCH: $urlArray = array( 'fullTextSearchID' => CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionValue', diff --git a/templates/CRM/Block/LangSwitch.tpl b/templates/CRM/Block/LangSwitch.tpl index 0ad26011e7..0c02cf258b 100644 --- a/templates/CRM/Block/LangSwitch.tpl +++ b/templates/CRM/Block/LangSwitch.tpl @@ -25,7 +25,7 @@ *} {if isset($langSwitch) and $langSwitch|@count > 1}
- {foreach from=$langSwitch item=language key=locale} {/foreach} diff --git a/templates/CRM/common/langSwitch.tpl b/templates/CRM/common/langSwitch.tpl deleted file mode 100644 index f861c36a8a..0000000000 --- a/templates/CRM/common/langSwitch.tpl +++ /dev/null @@ -1,36 +0,0 @@ -{* - +--------------------------------------------------------------------+ - | CiviCRM version 4.5 | - +--------------------------------------------------------------------+ - | Copyright CiviCRM LLC (c) 2004-2014 | - +--------------------------------------------------------------------+ - | This file is a part of CiviCRM. | - | | - | CiviCRM is free software; you can copy, modify, and distribute it | - | under the terms of the GNU Affero General Public License | - | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. | - | | - | CiviCRM is distributed in the hope that it will be useful, but | - | WITHOUT ANY WARRANTY; without even the implied warranty of | - | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | - | See the GNU Affero General Public License for more details. | - | | - | You should have received a copy of the GNU Affero General Public | - | License and the CiviCRM Licensing Exception along | - | with this program; if not, contact CiviCRM LLC | - | at info[AT]civicrm[DOT]org. If you have questions about the | - | GNU Affero General Public License or the licensing of CiviCRM, | - | see the CiviCRM license FAQ at http://civicrm.org/licensing | - +--------------------------------------------------------------------+ -*} -{if isset($langSwitch) and $langSwitch|@count > 1} -
- - - -
-{/if} -- 2.25.1