From c69140ee30ba40ef338fd66ae1bf5148c832c726 Mon Sep 17 00:00:00 2001 From: Jason Coward Date: Wed, 27 Sep 2023 11:56:58 -0600 Subject: [PATCH] Fix undefined global variable $_SESSION in a CLI connector (#16425) Co-authored-by: Thomas Jakobi --- core/model/modx/modconnectorrequest.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/model/modx/modconnectorrequest.class.php b/core/model/modx/modconnectorrequest.class.php index afe5df0db74..4017e85fedb 100644 --- a/core/model/modx/modconnectorrequest.class.php +++ b/core/model/modx/modconnectorrequest.class.php @@ -33,7 +33,8 @@ public function initialize() { if ($this->modx && is_object($this->modx->context) && $this->modx->context instanceof modContext) { $ctx = $this->modx->context->get('key'); if (!empty($ctx) && $ctx == 'mgr') { - $ml = $this->modx->getOption('manager_language',null,$this->modx->getOption('cultureKey',null,'en')); + $ml = $this->modx->getOption('manager_language', isset($_SESSION) ? $_SESSION : [], + $this->modx->getOption('cultureKey', null, 'en')); if (!empty($ml)) { $this->modx->setOption('cultureKey',$ml); }