From a1035f365e58ee25b4d4597f86ac39d5e82b16d8 Mon Sep 17 00:00:00 2001 From: benjamin Date: Fri, 23 Feb 2024 11:15:24 +0000 Subject: [PATCH] useFakeSession during install on Standalone --- CRM/Core/Config.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CRM/Core/Config.php b/CRM/Core/Config.php index ae76dd34cc7c..32dec2c7068d 100644 --- a/CRM/Core/Config.php +++ b/CRM/Core/Config.php @@ -91,6 +91,10 @@ public static function &singleton($loadFromDB = TRUE, $force = FALSE) { // Standalone's session cannot be initialized until CiviCRM is booted, // since it is defined in an extension, and we need the session // initialized before calling applyLocale. + if (defined('CIVI_SETUP')) { + // during Standalone install the extension isn't ready yet so we need a fake session + \CRM_Core_Session::useFakeSession(); + } $sess = \CRM_Core_Session::singleton(); $sess->initialize(); if ($sess->getLoggedInContactID()) {