Problem/Motivation

I am using Opigno LMS and this module is part of the distribution. I had to use the drush rr tool to fix something standard (other) that needed registry rebuilding and after that everything related to QuizQustion class started to break (I found just all question node forms to be broken at the time, did not dig deeper for other issues in the platform, as it's quite large...).

So the problem comes from the fact that the modules does some hacks to exclude a class files from other modules and include it's own on their place through hook_registry_files_alter. The issue is that after standard rebuild of the registry, the registry_files table is not refreshed, causing the class maps to not be excluded, from processing, due to no changes in them. This is preventing Drupal from auto-loading the QuizQuestion abstract base class that the module provides, causing the error.

How to reproduce:
1. Install quiz, quiz_question, og_quiz and all dependencies on a standard Drupal install.
2. Add a module that provides a quiz question type (short-answer) for example.
3. Run drush rr from the console in drupal's root folder.
4. Open the node/add/short-answer page. You should see 500 internal server error (WSOD).
5. Inspect PHP's error logs: PHP Fatal error: Class 'QuizQuestion' not found in .../profiles/opigno_lms/modules/contrib/quiz/question_types/short_answer/short_answer.classes.inc on line 22

Proposed resolution

Delete the entries for this module from registry_file table to force the re-parsing of files and this the class maps.

Remaining tasks

Patch, review RTBC, commit.

User interface changes

None.

API changes

None - Change in implementation detail.

Data model changes

None.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ndobromirov created an issue. See original summary.

ndobromirov’s picture

Status: Active » Needs review
Issue tags: +drush registry-rebuild, +Registry corruption
FileSize
1.54 KB

Here is a patch with the fix that worked for me.

  • Amermod committed 2f3a646 on 7.x-1.x
    Issue #2710875 by ndobromirov: Drush registry-rebuild causes registry...
amermod’s picture

Title: Drush registry-rebuild causes registry corruption. » [1.5] Drush registry-rebuild causes registry corruption.
Priority: Major » Normal
Status: Needs review » Patch (to be ported)

Hi ndobromirov,

Thanks for your issue.
I reviewed and tested your patch.
It works fine with it, so I committed.

amermod’s picture

Status: Patch (to be ported) » Fixed

v.1.5

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.