From 18436e43532efa0c52ac038c3b0b510007b45307 Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Mon, 21 Dec 2020 14:52:46 +1100 Subject: [PATCH] dev/core#2263 Do not try and store items in the session if the session is currently empty Store the locale in the session even if we are in a single lingual instance --- CRM/Core/BAO/ConfigSetting.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/CRM/Core/BAO/ConfigSetting.php b/CRM/Core/BAO/ConfigSetting.php index 54ad2e1a74..7fd74c1aeb 100644 --- a/CRM/Core/BAO/ConfigSetting.php +++ b/CRM/Core/BAO/ConfigSetting.php @@ -205,9 +205,6 @@ class CRM_Core_BAO_ConfigSetting { $chosenLocale = $defaultLocale; } - // Always assign the chosen locale to the session. - $session->set('lcMessages', $chosenLocale); - } else { @@ -216,6 +213,11 @@ class CRM_Core_BAO_ConfigSetting { } + if (!$session->isEmpty()) { + // Always assign the chosen locale to the session. + $session->set('lcMessages', $chosenLocale); + } + /* * Set suffix for table names in multi-language installs. * Use views if more than one language. -- 2.25.1