Take quiz gives error Error: Call to a member function access() on null in Drupal\quiz\Controller\QuizQuestionController->checkEntityAccess() (line 174 of modules/contrib/quiz/src/Controller/QuizQuestionController.php).

Created on 31 October 2019, almost 6 years ago
Updated 27 August 2025, 17 days ago

Even logged in as admin or other user profiles (authenticated users) I get this error

Error: Call to a member function access() on null in Drupal\quiz\Controller\QuizQuestionController->checkEntityAccess() (line 174 of modules/contrib/quiz/src/Controller/QuizQuestionController.php).

Screenshot

🐛 Bug report
Status

Closed: cannot reproduce

Version

5.0

Component

Code - Quiz core

Created by

🇵🇰Pakistan isalmanhaider

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.

  • 🇭🇰Hong Kong VortexCentrum

    Reopening - recurrence of error .

    I have the following.

    Drupal 11.2.3
    Quiz 7.0.0
    PHP 8.3.24
    Composer installation

    TypeError: Drupal\quiz\Entity\QuizQuestionRelationship::getQuestion(): Return value must be of type Drupal\Core\Entity\RevisionableInterface, null returned in Drupal\quiz\Entity\QuizQuestionRelationship->getQuestion() (line 137 of /home/customer/www/financialcrimetraining.com/public_html/elan/web/modules/contrib/quiz/src/Entity/QuizQuestionRelationship.php).

    When I click Take Quiz, I get the "unexpected error" message and this is in the log.

    It looks as if there was no clear resolution to this earlier so perhaps someone crashed into the solution but didn't tell the rest of us :)

Production build 0.71.5 2024