We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I no $_SESSION array is set, lexicon->load crashes.
Call lexicon->load() with no $_SESSION set and $modx->context set to 'mgr'.
Here is the offending code (around line 189 of core/src/Revolution/modLexicon.php)
if ($this->modx->context && $this->modx->context->get('key') == 'mgr') { $defaultLanguage = $this->modx->getOption('manager_language', $_SESSION, $this->modx->getOption('cultureKey', null, 'en')); } else { $defaultLanguage = $this->modx->getOption('cultureKey', null, 'en'); }
This will break testing code. (i.e. Unit, Integration, or Acceptance test) that call $lexicon->load();.
$lexicon->load();
There are a number ways to fix this. This is one (just above the first getOption() call), but I'm not sure it's the best:
if (! isset($_SESSION)) { $_SESSION = null; }
MODX 3, Windows 10, apache
The text was updated successfully, but these errors were encountered:
What do you mean exactly by "crashes"? Is it causing an error or unexpected behavior downstream?
Sorry, something went wrong.
Sorry, attempting to access a member of an array that doesn't exist throws a PHP error: Unknown variable $_SESSION.
$_SESSION
I think a better solution is to put this above the first getOption() call:
$_SESSION = isset($_SESSION)? $_SESSION : array();
Fixed #15377
No branches or pull requests
Bug report
Summary
I no $_SESSION array is set, lexicon->load crashes.
Step to reproduce
Call lexicon->load() with no $_SESSION set and $modx->context set to 'mgr'.
Here is the offending code (around line 189 of core/src/Revolution/modLexicon.php)
This will break testing code. (i.e. Unit, Integration, or Acceptance test) that call
$lexicon->load();
.There are a number ways to fix this. This is one (just above the first getOption() call), but I'm not sure it's the best:
Environment
MODX 3, Windows 10, apache
The text was updated successfully, but these errors were encountered: