Check for session before calling Request::getSession()

Created on 6 July 2023, 12 months ago
Updated 10 July 2023, 12 months ago

Problem/Motivation

Getting error when running phpunit functional tests on our project:

Symfony\Component\HttpFoundation\Exception\SessionNotFoundException: Session has not been set.

/var/www/html/vendor/symfony/http-foundation/Request.php:724
/var/www/html/web/modules/contrib/computed_breadcrumbs/src/Field/ComputedBreadcrumbsItemList.php:41

Proposed resolution

Call Request::hasSession() before Request::getSession().

πŸ› Bug report
Status

Fixed

Version

1.1

Component

Code

Created by

πŸ‡­πŸ‡ΊHungary szato

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

Comments & Activities

Production build 0.69.0 2024