Skip to content

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

Closed
@hundrex

Description

@hundrex
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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions