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

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

XMLWordPrintable

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

      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

        1. mysql.php
          64 kB
          Pavel Krejci

            timhunt Tim Hunt
            complicator Pavel Krejci
            Nobody Nobody (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.