Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Call to a member function isActive() on null after update to 3.4.0-BETA4 Symfony version #25087

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

Closed
hundrex opened this issue Nov 21, 2017 · 4 comments

Comments

@hundrex
Copy link

hundrex commented Nov 21, 2017

Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no
Symfony version 3.4.0-BETA4
PHP version 7.0.25

It's my first time reporting a bug, so don't hesitate to tell me if I forgot some information.

After upgrading to Symfony 3.4.0-BETA4, I have an error when calling session objects, similar to the one in issue #24934 .

The error message is Call to a member function isActive() on null., and it occurs when the following code is encountered :

...
$session->getFlashBag()->add('success', 'Welcome '.$account->getUsername());
$session->set('isConnected', true);
$session->set('account', $account);
...

Here is my stacktrace :

Symfony\Component\Debug\Exception\FatalThrowableError:
Call to a member function isActive() on null

  at vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php:304
  at Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage->getBag('attributes')
     (vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Session/Session.php:243)
  at Symfony\Component\HttpFoundation\Session\Session->getAttributeBag()
     (vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Session/Session.php:79)
  at Symfony\Component\HttpFoundation\Session\Session->set('isConnected', true)
     (src/AppBundle/Controller/SecurityController.php:37)
  at AppBundle\Controller\SecurityController->loginAction(object(Request))
  at call_user_func_array(array(object(SecurityController), 'loginAction'), array(object(Request)))
     (vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:153)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1)
     (vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:68)
  at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true)
     (vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:202)
  at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
     (web/app_dev.php:29)
  at require('/home/hundrix/devProjects/succube-sarl/web/app_dev.php')
     (vendor/symfony/symfony/src/Symfony/Bundle/WebServerBundle/Resources/router.php:42)

So similar to #24934 , the error seems to come from file src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php. I saw that commit 5cada3a from #24946 has solved the problem for 3.3.11, so I wonder if this fix is not already on 3.4.0, or if I'm on the wrong 3.4.0 version.

Thank you for your time, and let me know if I missed something.

@stof
Copy link
Member

stof commented Nov 21, 2017

The bug fix is part of 3.4.0-RC1. Beta4 was released before the bugfix was merged

@stof stof closed this as completed Nov 21, 2017
@hundrex
Copy link
Author

hundrex commented Nov 21, 2017

Thank you for your quick answer, but I'm wondering how I can fix my problem with my actual version then, as it seems that 3.4.0-RC1 is not already released?

@nicolas-grekas
Copy link
Member

wait like 10 minutes for RC1 to be ready, if it's not already :)

@hundrex
Copy link
Author

hundrex commented Nov 21, 2017

Thank you! I just updated to 3.4.0-RC1 and it is working just fine!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants