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

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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.3, 2.4
    • Fix Version/s: 2.3.3
    • Component/s: Installation
    • Labels:
    • Testing Instructions:
      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!
    • Affected Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      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'.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Votes:
                  1 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    12/Nov/12