Uploaded image for project: 'Plugins'
  1. Plugins
  2. CONTRIB-5884

Editing Maximum grade results in database error

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.8.7
    • Fix Version/s: None
    • Component/s: Package: Checklist
    • Labels:
      None
    • Plugin Version:
      2015050901
    • Affected Branches:
      MOODLE_28_STABLE

      Description

      Replication Steps:

      1. Create new course
      2. Create Checklist activity
      3. Edit Checklist activity, change "Maximum grade".
      4. Should result in "Error reading from database"

      Debug info:

      Unknown column 'completionpercent' in 'field list'
      SELECT completionpercent FROM mdl_checklist WHERE id = ?
      [array (
      0 => '1',
      )]
      Error code: dmlreadexception
      

      Stack trace:

      line 443 of /lib/dml/moodle_database.php: dml_read_exception thrown
      line 1080 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
      line 1476 of /lib/dml/moodle_database.php: call to mysqli_native_moodle_database->get_records_sql()
      line 1549 of /lib/dml/moodle_database.php: call to moodle_database->get_record_sql()
      line 1530 of /lib/dml/moodle_database.php: call to moodle_database->get_field_sql()
      line 1509 of /lib/dml/moodle_database.php: call to moodle_database->get_field_select()
      line 97 of /mod/checklist/lib.php: call to moodle_database->get_field()
      line 541 of /course/modlib.php: call to checklist_update_instance()
      line 264 of /course/modedit.php: call to update_moduleinfo()
      

      Creating the int(10) database field [prefix]_checklist.completionpercent resolves this issue. It appears there may not have been created in previous plugin upgrades. This site was migrated from self-hosting so I'm not sure what previous versions they ran. This may be a one off issue and it should now affect new installs. Reporting it here in case someone else runs into the same issue and can provide further information.

        Attachments

          Activity

            People

            Assignee:
            davosmith Davo Smith
            Reporter:
            geeksmith Chris Megahan
            Participants:
            Component watchers:
            Davo Smith
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: