Check for session before calling Request::getSession()

Created on 6 July 2023, over 1 year ago
Updated 10 July 2023, over 1 year 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.71.5 2024