setLocale: precaution for when setLocale is called on an unilingual site
authorMathieu Lutfy <mathieu@bidon.ca>
Tue, 15 Jan 2019 19:14:53 +0000 (14:14 -0500)
committerMathieu Lutfy <mathieu@bidon.ca>
Tue, 15 Jan 2019 19:14:53 +0000 (14:14 -0500)
CRM/Core/I18n.php

index 02340b421c1abfa1dfd8a86723ce85d2a1d2c2ca..119ff57f9dae8c004dcdf1276d263f805e748933 100644 (file)
@@ -667,9 +667,12 @@ class CRM_Core_I18n {
       $this->setPhpGettextLocale($locale);
     }
 
-    // for sql queries
+    // For sql queries, if running in DB multi-lingual mode.
     global $dbLocale;
-    $dbLocale = "_{$locale}";
+
+    if ($dbLocale) {
+      $dbLocale = "_{$locale}";
+    }
 
     // For self::getLocale()
     global $tsLocale;