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

Moodle 2.2 upgrade to 2.3 error: Unknown column 'retrictmodules' in 'where clause'

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • 2.3.3
    • 2.3, 2.4
    • Installation
    • MOODLE_23_STABLE, MOODLE_24_STABLE
    • MOODLE_23_STABLE
    • Hide

      You need to test upgrading a site from 2.2 to 2.3, where $CFG->restrictmodulesfor is set to 'requested'.

      So, that is rather like the MDL-19125 testing instructions, except that we clearly failed to test that case before. Oops!

      Show
      You need to test upgrading a site from 2.2 to 2.3, where $CFG->restrictmodulesfor is set to 'requested'. So, that is rather like the MDL-19125 testing instructions, except that we clearly failed to test that case before. Oops!

      Error Message :

      Default exception handler: Error reading from database Debug: Unknown column 'retrictmodules' in 'where clause'
      SELECT id, 1 FROM mdl_course WHERE retrictmodules = ? ORDER BY id
      [array (
      0 => 1,
      )]

      Error code: dmlreadexception

      • line 407 of \lib\dml\moodle_database.php: dml_read_exception thrown
      • line 864 of \lib\dml\mysqli_native_moodle_database.php: call to moodle_database->query_end()
      • line 1166 of \lib\dml\moodle_database.php: call to mysqli_native_moodle_database->get_records_sql()
      • line 1113 of \lib\dml\moodle_database.php: call to moodle_database->get_records_select()
      • line 1206 of \lib\dml\moodle_database.php: call to moodle_database->get_records()
      • line 251 of \lib\db\upgrade.php: call to moodle_database->get_records_menu()
      • line 1481 of \lib\upgradelib.php: call to xmldb_main_upgrade()
      • line 275 of \admin\index.php: call to upgrade_core()

      ============================================================================
      Part source codes of \lib\db\upgrade.php as follow.

      if ($oldversion < 2012031500.01) {
      // Upgrade old course_allowed_modules data to be permission overrides.
      if ($CFG->restrictmodulesfor === 'all')

      { $courses = $DB->get_records_menu('course', array(), 'id', 'id, 1'); }

      else if ($CFG->restrictmodulesfor === 'requested')

      { $courses = $DB->get_records_menu('course', array('retrictmodules' => 1), 'id', 'id, 1'); }

      else

      { $courses = array(); }

      =============================================================================
      'retrictmodules' need replace by 'restrictmodules'.

            timhunt Tim Hunt
            wcchien Chien Wen-Chang(簡文章)
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

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