New issue
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
Update modLexicon.php #15377
Update modLexicon.php #15377
Conversation
Thank you for your contribution! Before your pull request can be reviewed, please sign the MODX Contributor License Agreement (CLA). This is to make sure MODX has your written permission to distribute projects containing your contributions under the appropriate license. Please make sure the CLA has been signed for GitHub user(s): @BobRay Once you've signed, please reply with |
@cla-bot check
…On Sat, Feb 6, 2021 at 4:23 PM cla-bot[bot] ***@***.***> wrote:
Thank you for your contribution! Before your pull request can be reviewed,
please sign the MODX Contributor License Agreement (CLA)
<https://modx.com/community/contribute/cla/>. This is to make sure MODX
has your written permission to distribute projects containing your
contributions under the appropriate license.
Please make sure the CLA has been signed for GitHub user(s): @BobRay
<https://github.com/BobRay>
Once you've signed, please reply with @cla-bot check to verify and update
the status of this pull request.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#15377 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACRZIUQBBEQH3G44M2IU33S5WXNRANCNFSM4XGVXNNA>
.
|
The cla-bot has been summoned, and re-checked this pull request! |
Using the null coalescing operator is fine with me. |
I modified this to use the null coalescing operator rather than setting the global variable $_SESSION. Though chances are slim this would ever have a real-world consequence, setting the value of a PHP superglobal to avoid an error seemed like the wrong approach. |
Accepted your null coalescing operator suggestion.
It regularly crashed Codeception acceptance tests of the MODX Manager, so I'm glad it's fixed. Using the null coalescing operator is a much better approach than mine. |
Sanity check to prevent PHP error if $_SESSION is not set
What does it do?
Make sure $_SESSION variable exists before it's referenced
Why is it needed?
Existing code breaks automated acceptance tests (and possibly unit tests) where $_SESSION isn't necessarily set.
Related issue(s)/PR(s)
Issue: #15373