I have upgraded from supported stable quiz 4 to 5 (a month ago to alpha8 and again yesterday to alpha9) and have the same problem with db update 7401 quiz_question_update which fails and prevents db updates 7500 7501 7502 and 7514 (as well as the db updates for some other modules) from processing. This is happening on 5 sites (on an aegir multisite configuration). It doesn't seem to matter whether I enable or disable the quiz modules, etc. What do you suggest? Should I look for and 4 series entries in the db itself and remove them in order to proceed? or do you want to try to patch this so others don't have the same problem?

Best,

Ed

Comments

EM-fast1’s picture

The exact error I receive is:

drush dbup:
Lang_dropdown 7201 Rearrange options arrays.
Quiz_question 7401 Make the question body visible by default for the
question view mode
Quiz_question 7500 Add fields for general question feedback.
Quiz_question 7501 Drop table {quiz_question_latest_quizzes}.
Quiz_question 7502 Add missing question_id index.
Quiz 7514 Adding default admin review options.
Do you wish to run all pending updates? (y/n): y

Fatal error: Call to undefined function quiz_question_get_info() in /data/disk/f
ast1/static/7h/sites/all/modules/quiz/question_types/quiz_question/quiz_question
.install on line 78
Drush command terminated abnormally due to an unrecoverable error. [error]
Error: Call to undefined function quiz_question_get_info() in
/data/disk/fast1/static/7h/sites/all/modules/quiz/question_types/quiz_question/q
uiz_question.install,
line 78
The external command could not be executed due to an application [error]
error.
-------------------------------------------
and the function is:

/**
* Make the question body visible by default for the question view mode
*/
function quiz_question_update_7401() {
$question_types = array_keys(quiz_question_get_info());

foreach ($question_types as $question_type) {
$instance = field_read_instance('node', 'body', $question_type);

$instance['display']['question'] = array(
'label' => 'hidden',
'type' => 'text_default',
'weight' => 1,
'settings' => array(),
'module' => 'text',
);

field_update_instance($instance);
}
}

---------------------------

So, my question is: Since i'll stay with quiz 5, can I safely remove that function from that file?

djdevin’s picture

Hi, that's really strange because quiz_question_get_info() definitely does exist in Quiz5. let me look in to this

djdevin’s picture

Can you help me debug this, and put this at the top of of function so it looks like this:

function quiz_question_update_7401() {
  drupal_load('module', 'quiz_question');
[....]

This shouldn't be necessary and I'm not sure why quiz_question_get_info() would not be available. Can you make sure you 1) only have one quiz directory and 2) make sure any files from 4.x are gone (so - delete quiz 4, and add quiz 5)

Those updates are pretty important and have to be run. In the tests, we actually have a test case from Quiz 4 -> Quiz 5.

To quickly debug this issue, if you are able to it would be nice to get a copy of your database dump. You can private message me if you're interested in doing that.

EM-fast1’s picture

I did as you asked, and the db update did NOT succeed. Here is the error message:

The following updates returned messages

quiz_question module

Update #7401
Failed: FieldException: Attempt to update an instance of a nonexistent field . in field_update_instance() (line 557 of /data/disk/fast1/static/7h/modules/field/field.crud.inc).

FYI: the quiz module in this BOA / aegir mulitsite is actually in /data/disk/fast1/static/7h/sites/all/modules/quiz - this is where all the contrib modules are.

7h is the platform name. The core modules are in .../7h/modules/

I will get you a db dump. What e"lse can I do to debug this?

Thank you.

djdevin’s picture

Do all of your question types have "body" fields?

This is the same issue as #2374409: Update #7401 Failed: FieldException: Attempt to update an instance of a nonexistent field error, and is actually a 4.x upgrade issue not related to the 5.x upgrade.

EM-fast1’s picture

There aren't any questions actually - I haven't touched a thing - these are just sites that are being built slowly on-line, and which are planning on using the quiz module, and have thus enabled it, without actually creating any quizzes or questions! Does that make a difference as regards the db update problem?

EM-fast1’s picture

Adding that one line to the .install file (as you requested in #3, above, (

function quiz_question_update_7401() {
  drupal_load('module', 'quiz_question');
[....]

)

caused the site to go down completely, so I have had to remove it.

djdevin’s picture

I think I need your DB dump. I installed 4.x and tried upgrade to 5.x with a number of combinations and cannot trigger the error at all.

EM-fast1’s picture

By disabling all the quiz question sub-modules EXCEPT quiz and quiz_question themselves, and at the same time ENABLING quiz_pages, I have been able to get the db updates to work!

How can I help you you to debug this, so others won't have this problem?

EM-fast1’s picture

I will test this method on a different site now.

djdevin’s picture

My initial guess is that you are behind on the 4.x branch, since 7401 has to run. And something doesn't work when it's going from that specific version of 4.x -> 5.x. So if you remember exactly what version it was I can also try that one.

The automated test went from the latest -dev at the time, which already included that update, so it doesn't run.

EM-fast1’s picture

I can now confirm that the db update works without problems when the following conditions are met:

ONLY quiz, quiz question and quiz pages are enabled

All other quiz question sub-modules are disabled

Clear caches and run db update - it works.

Thank you.

EM-fast1’s picture

In fact, it isn't even necessary to enable quiz pages in order for the db update to run. Just disabling all the quiz question sub-modules seems to work.

Additionally, there seems to be a new requirement for quiz_statistics (charts), which I don't have. Thus at one time it was possible to enable quiz_statistics without chart. So when I save the modules page, I receive an error messages telling me that since charts is missing, quiz_statistics will be disabled.

Le module charts est manquant, le module suivant sera donc désactivé : quiz_stats. (French)

So, could this also possibly be the reason why the db update wouldn't take?

EM-fast1’s picture

That must be the fix.

djdevin’s picture

Status: Active » Closed (fixed)