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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.6.3
    • Fix Version/s: 1.6.5, 1.7.2, 1.8, 1.9
    • Component/s: Quiz
    • Labels:
      None
    • Environment:
      Windows
    • Database:
      MySQL
    • Affected Branches:
      MOODLE_16_STABLE
    • Fixed Branches:
      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

            • Assignee:
              timhunt Tim Hunt
              Reporter:
              complicator Pavel Krejci
              Tester:
              Nobody
              Participants:
              Component watchers:
              Tim Hunt, Andrew Nicols, Mathew May, Michael Hawkins, Shamim Rezaie, Simey Lameze
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                30/Mar/07