CRM_Core_I18n - Reduce queries for localized word-replacements.
authorTim Otten <totten@civicrm.org>
Sun, 15 Nov 2015 22:18:18 +0000 (14:18 -0800)
committerTim Otten <totten@civicrm.org>
Sun, 15 Nov 2015 22:18:18 +0000 (14:18 -0800)
CRM/Core/I18n.php

index 6a4fdd0722efbc2085d903db6e4978da7e4d0d4e..d16b380feb45e0b3d00fa9ec75dc6c9ac7c2d904 100644 (file)
@@ -347,7 +347,8 @@ class CRM_Core_I18n {
     }
 
     // do all wildcard translations first
-    if (!isset(Civi::$statics[__CLASS__][$this->locale])) {
+
+    if (!isset(Civi::$statics[__CLASS__]) || !array_key_exists($this->locale, Civi::$statics[__CLASS__])) {
       if (defined('CIVICRM_DSN') && !CRM_Core_Config::isUpgradeMode()) {
         Civi::$statics[__CLASS__][$this->locale] = CRM_Core_BAO_WordReplacement::getLocaleCustomStrings($this->locale);
       }