Call to a member function get() on null in Drupal\autologout\EventSubscriber\AutologoutSubscriber->onRequest()

Created on 20 December 2022, about 2 years ago
Updated 10 October 2023, over 1 year ago

Problem/Motivation

When send a request of SUB_REQUEST type $this->requestStack->getCurrentRequest()->getSession() returns NULL and therefore we get an error trying to call function get() on NULL.
From Session::handle() method: session is set only for MASTER_REQUEST type requests.

Drupal core version: 9.4.8
Autologout module version: 8.x-1.4

Error message
Error: Call to a member function get() on null in Drupal\autologout\EventSubscriber\AutologoutSubscriber->onRequest() (line 123 of modules/contrib/autologout/src/EventSubscriber/AutologoutSubscriber.php)

Steps to reproduce

  • Find any usage of sub request (e.g. search for ->handle($subrequest, HttpKernelInterface::SUB_REQUEST)) and try to send this request so it would lead to AutologoutSubscriber::onRequest() method and cause the issue
  • OR
  • Install Ctools module β†’
  • Install Layout builder library module OR any other module that allows to add conditions(e.g. pathauto_condition_ui provided by pathauto β†’ module
  • try to add a condition on Manage conditions page
πŸ› Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

πŸ‡§πŸ‡ΎBelarus sergey.semchuk

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024