From: Rich Lott / Artful Robot Date: Mon, 20 Feb 2023 13:46:04 +0000 (+0000) Subject: standalone: when users extension not available create fake user IDs in session X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=e5f26bf8ed5490e8eafd87f2d1f54aa3a85e510a;p=civicrm-core.git standalone: when users extension not available create fake user IDs in session --- diff --git a/CRM/Utils/System/Standalone.php b/CRM/Utils/System/Standalone.php index 29677f3a44..148f53d46e 100644 --- a/CRM/Utils/System/Standalone.php +++ b/CRM/Utils/System/Standalone.php @@ -28,6 +28,20 @@ class CRM_Utils_System_Standalone extends CRM_Utils_System_Base { $this->missingStandaloneExtension = !class_exists(\Civi\Standalone\Security::class); } + /** + * Start a new session. + */ + public function sessionStart() { + parent::sessionStart(); + if ($this->missingStandaloneExtension) { + // Provide a fake contact and user ID, otherwise we don't get a menu. + $session = CRM_Core_Session::singleton(); + $session->set('userID', 1); + $session->set('ufID', 1); + } + } + + /** * @inheritdoc */