Undefined variable: _SESSION in quiz_question_feedback_access(

Created on 26 November 2021, about 3 years ago
Updated 6 September 2024, 3 months ago

Problem/Motivation

Perhaps an extender to https://www.drupal.org/project/quiz/issues/3118506 β†’

3 consequent messages repeatedly appear in watchdog, always the same location, only difference is a question NID:/node/quiz-nid/take/question NID/feedback

1. Notice: Undefined variable: _SESSION in quiz_question_feedback_access() (line 3677 of /home/public_html/sites/all/modules/quiz/quiz.module).

2. Warning: array_flip(): Can only flip STRING and INTEGER values! in EntityAPIController->load() (line 219 of /home/public_html/sites/all/modules/entity/includes/entity.controller.inc).

3. Error: Call to a member function getLayout() on boolean in quiz_question_feedback_access() (line 3683 of /home/public_html/sites/all/modules/quiz/quiz.module).

Steps to reproduce

Open domain.tld/node/quiz-nid/take/question-nid in a browser incognito mode.
"Allow resume" and "Backward navigation" is enabled in a quiz settings.

Proposed resolution

Since it starts from losing _SESSION notice, it might be caused by users continuing a quiz but logged out by some reason.
Perhaps check for _SESSION data and if empty or not exists redirect to /user/login or to domain.tld/node/quiz-nid/take

πŸ› Bug report
Status

Closed: outdated

Version

5.5

Component

Code - Quiz core

Created by

πŸ‡ΈπŸ‡°Slovakia yurg

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.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    With D7 EOL approaching starting to triage the D7 quiz queue. Since there is no patch and not moved in 4 years going to close out. But if a problem in 7.0.x please reopen

Production build 0.71.5 2024