Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-52291

Table "qtype_multichoice_options" does not exist!!! Upgrading from 2.4.10 to 3.0

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 3.0
    • 3.0.1
    • Questions
    • MOODLE_30_STABLE
    • MOODLE_30_STABLE
    • Hide

      Upgrade to current Moodle 2.9.x+ and then to Moodle 3.x+

      Show
      Upgrade to current Moodle 2.9.x+ and then to Moodle 3.x+
    • Hide

      Upgrading from old sites (< 2.6).

      0) Install Moodle version before 2.6 (2.4, 2.5 is ok).
      1) Ensure it contains some multianswer (cloze) questions having multichoice questions on it* (you can use restore the attached backup file which has a course with the necessary activities)
      2) Upgrade to Moodle 3.0.x+ (master), verify the process ends without problems and the question looks (preview) ok.

      Upgrading from newer sites (>= 2.6).

      0) Install Moodle version equal or after 2.6.
      1) Ensure it contains some multianswer (cloze) questions having multichoice questions on it*. (you can use restore the attached backup file which has a course with the necessary activities)
      2) Upgrade to Moodle 3.0.x+ (master), verify the process ends without problems and the question looks (preview) ok.

      * Trick: Some trick, known content (cloze example, backup file...) to ensure the data is correct for testing purposes is welcome. Surely the examples in the docs are ok, but need confirmation. <== confirmed, I've been able to reproduce the problem with the 2 example questions provided there created in test site.

      Show
      Upgrading from old sites (< 2.6). 0) Install Moodle version before 2.6 (2.4, 2.5 is ok). 1) Ensure it contains some multianswer (cloze) questions having multichoice questions on it* (you can use restore the attached backup file which has a course with the necessary activities) 2) Upgrade to Moodle 3.0.x+ (master), verify the process ends without problems and the question looks (preview) ok. Upgrading from newer sites (>= 2.6). 0) Install Moodle version equal or after 2.6. 1) Ensure it contains some multianswer (cloze) questions having multichoice questions on it*. (you can use restore the attached backup file which has a course with the necessary activities) 2) Upgrade to Moodle 3.0.x+ (master), verify the process ends without problems and the question looks (preview) ok. * Trick: Some trick, known content (cloze example, backup file...) to ensure the data is correct for testing purposes is welcome. Surely the examples in the docs are ok, but need confirmation. <== confirmed, I've been able to reproduce the problem with the 2 example questions provided there created in test site.

    Description

      Error

      During the upgrade to Moodle 3.0 from 2.4.10 (via CLI). When it upgrade the qtype plugins, it show this error:

      ++ Success ++
      -->qtype_match
      ++ Success ++
      -->qtype_missingtype
      ++ Success ++
      -->qtype_multianswer
      !!! Table "qtype_multichoice_options" does not exist !!!
      !! 
      Error code: ddltablenotexist !!
      !! Stack trace: * line 585 of /lib/dml/moodle_database.php: dml_exception thrown
      * line 1428 of /lib/dml/moodle_database.php: call to moodle_database-&gt;where_clause()
      * line 76 of /question/type/multianswer/db/upgrade.php: call to moodle_database-&gt;get_record()
      * line 545 of /lib/upgradelib.php: call to xmldb_qtype_multianswer_upgrade()
      * line 1641 of /lib/upgradelib.php: call to upgrade_plugins()
      * line 171 of /admin/cli/upgrade.php: call to upgrade_noncore()
       !!
      

      I found in line 76 of */question/type/multianswer/db/upgrade.php * that in fact, it seeks qtype_multichoise_option table but it does not exist.
      I have seen in question/type/multichoice/db/upgrade.php that this table is renamed to qtype_multichoice_options in one of the upgrade steps as I show below.

      if ($oldversion < 2013092301) {
       
              // Define table question_multichoice to be renamed to qtype_multichoice_options.
              $table = new xmldb_table('question_multichoice');
       
              // Launch rename table for question_multichoice.
              $dbman->rename_table($table, 'qtype_multichoice_options');
       
              // Record that qtype_match savepoint was reached.
              upgrade_plugin_savepoint(true, 2013092301, 'qtype', 'multichoice');
          }
      

      I think is a core issue becouse it should upgrade first qtype_multichoice and then qtype_multipleanswer.

      This issue can only be reproduced upgrading from any version lower than 2.6 to moodle 3.0 via CLI. In this case, from moodle 2.4.

      FULL STEPS

      time /usr/bin/php /var/www/html/moodle/admin/cli/upgrade.php --non-interactive | tee /log/"`date +"%Y%m%d_%H%M"`_upgrade.log"
      

      I know that I can upgrade first to any version lower than moodle 3.0 and then to 3.0, but i think it shouldn't occur.

      Attachments

        Issue Links

          Activity

            People

              stronk7 Eloy Lafuente (stronk7)
              fontinixxl Gerard Cuello Adell
              David Monllaó David Monllaó
              Dan Poltawski Dan Poltawski
              Dan Poltawski Dan Poltawski
              Tim Hunt, Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              2 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                21/Dec/15