-
-
Notifications
You must be signed in to change notification settings - Fork 528
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
Fix undefined global variable $_SESSION in a CLI connector #16422
Conversation
@Jako thank you for all the help. |
Codecov ReportPatch and project coverage have no change.
Additional details and impacted files@@ Coverage Diff @@
## 3.x #16422 +/- ##
=========================================
Coverage 21.75% 21.75%
Complexity 10478 10478
=========================================
Files 561 561
Lines 31590 31590
=========================================
Hits 6872 6872
Misses 24718 24718
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
Thanks for this, but I wonder why a connector is being called via CLI. Connectors are meant to provide web access to processors, so the fact CLI scripts are calling them is a little confusing. |
Also, is this not an issue in 2.x? |
I have seen this CLI usage of a connector in a lot extras. The code for CLI and connector usage can be the same. It should also be relevant in 2.x and it occurs only with the more strict checks of PHP 8 in both versions (added this above). |
What does it do?
Use an empty array, if the global $_SESSION variable does not exist
Why is it needed?
Fix the warning
(ERROR @ /www/core/src/Revolution/modConnectorRequest.php : 41) PHP warning: Undefined global variable $_SESSION
, when a connector is called via CLI. The issue occurred first with the more strict checks of PHP 8.How to test
It currently occurs with CronManager, when
assets/components/cronmanager/cron.php
is executed by CLI. Agenda has the same issue.Related issue(s)/PR(s)
None known.