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

bad use of DESCRIPTION constant in quiz module causes upgrade to fail

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.6.3
    • 1.6.5, 1.7.2, 1.8, 1.9
    • Quiz
    • None
    • Windows
    • MySQL
    • MOODLE_16_STABLE
    • MOODLE_16_STABLE, MOODLE_17_STABLE, MOODLE_18_STABLE, MOODLE_19_STABLE

    Description

      http://moodle.org/mod/forum/discuss.php?d=61926

      The upgrade process handled by mod\quiz\db\mysql.php fails without giving proper feedback.

      The critical line (#890) is:
      $success = $success && execute_sql("UPDATE {$CFG->prefix}quiz_questions SET defaultgrade = '0' WHERE qtype = '".DESCRIPTION."'", false);

      as a hotfix, change it to:
      $success = $success && execute_sql("UPDATE {$CFG->prefix}quiz_questions SET defaultgrade = '0' WHERE qtype = '7'", false);

      The script uses new qtype constant when it should use the old number codes.

      Alternatively, as a hotfix, you can comment out the whole IF:
      if ($success && $oldversion < 2006021101)
      since the comment says its not necessary

      I am also attaching version of mysql.php, that worked for me. Note that the constant is present on more places.

      -Pavel

      Attachments

        Activity

          People

            timhunt Tim Hunt
            complicator Pavel Krejci
            Nobody Nobody
            Tim Hunt, Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Stevani Andolo
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              30/Mar/07