Skip to content
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: bug 4.4.4 spark serve not working when using Session in Routes.php #8389

Merged
merged 2 commits into from
Dec 30, 2023
Merged

fix: bug 4.4.4 spark serve not working when using Session in Routes.php #8389

merged 2 commits into from
Dec 30, 2023

Conversation

ALTITUDE-DEV-FR
Copy link
Contributor

@ALTITUDE-DEV-FR ALTITUDE-DEV-FR commented Dec 30, 2023

After upgrading 4.4.3 to 4.4.4 a bug are coming, spark not launching the CI with cmd. php spark server*

Error log:
bugci

Undefined global variable $_SESSION

at SYSTEMPATH\Session\Session.php:499

Backtrace:
1 SYSTEMPATH\Session\Session.php:499
CodeIgniter\Debug\Exceptions()->errorHandler(2, 'Undefined global variable $_SESSION', 'C:\wamp64\www\system\Session\Session.php', 499)

My fix working with no errors and launching correctly CI.

Description
Explain what you have changed, and why.

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

After upgrading 4.4.3 to 4.4.4 a bug are coming, spark not launching the CI with cmd. php spark server*

Error log: 

Undefined global variable $_SESSION

at SYSTEMPATH\Session\Session.php:499

Backtrace:
  1    SYSTEMPATH\Session\Session.php:499
       CodeIgniter\Debug\Exceptions()->errorHandler(2, 'Undefined global variable $_SESSION', 'C:\\wamp64\\www\\system\\Session\\Session.php', 499)

My fix working with no errors and launching correctly CI.
@kenjis kenjis added the bug Verified issues on the current code behavior or pull requests that will fix them label Dec 30, 2023
@kenjis
Copy link
Member

kenjis commented Dec 30, 2023

I have confirmed this.

--- a/app/Config/Routes.php
+++ b/app/Config/Routes.php
@@ -6,3 +6,4 @@ use CodeIgniter\Router\RouteCollection;
  * @var RouteCollection $routes
  */
 $routes->get('/', 'Home::index');
+session('rank');
$ ./spark serve

CodeIgniter v4.4.4 Command Line Tool - Server Time: 2023-12-30 08:09:27 UTC+00:00

[ErrorException]
Undefined global variable $_SESSION
at SYSTEMPATH/Session/Session.php:499

Backtrace:
  1    SYSTEMPATH/Session/Session.php:499
       CodeIgniter\Debug\Exceptions()->errorHandler(2, 'Undefined global variable $_SESSION', '/Users/kenji/work/codeigniter/official/CodeIgniter4/system/Session/Session.php', 499)

  2    SYSTEMPATH/Common.php:986
       CodeIgniter\Session\Session()->get('rank')

  3    APPPATH/Config/Routes.php:9
       session('rank')

  4    SYSTEMPATH/Router/RouteCollection.php:344
       require('/Users/kenji/work/codeigniter/official/CodeIgniter4/app/Config/Routes.php')

  5    SYSTEMPATH/CLI/Console.php:39
       CodeIgniter\Router\RouteCollection()->loadRoutes()

  6    ROOTPATH/spark:102
       CodeIgniter\CLI\Console()->run()

Copy link
Member

@kenjis kenjis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@kenjis kenjis changed the title Fix bug 4.4.4 spark not working Fix bug 4.4.4 spark serve not working when using Session in Routes.php Dec 30, 2023
@samsonasik samsonasik merged commit 7b7e63c into codeigniter4:develop Dec 30, 2023
59 checks passed
@samsonasik
Copy link
Member

Thank you @ALTITUDE-DEV-FR

@ALTITUDE-DEV-FR
Copy link
Contributor Author

Thank you @ALTITUDE-DEV-FR

Happy to help with my favorite PHP framework ;)
PS: I never use GitHub, sorry if my commits aren't up to standards; I mainly work on GitLab ^^

@jozefrebjak
Copy link
Contributor

@kenjis I have also this problem, but with inserting data to database with queue library, when to expect v4.4.5? Now I need to downgrade to v4.4.3

@kenjis kenjis changed the title Fix bug 4.4.4 spark serve not working when using Session in Routes.php fix: bug 4.4.4 spark serve not working when using Session in Routes.php Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Verified issues on the current code behavior or pull requests that will fix them
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants