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

Database error in resources.php

    Details

    • Testing Instructions:
      Hide
      1. Find or create a mod plugin with:
        1. pluginname_supports(FEATURE_MOD_ARCHETYPE) returning MOD_ARCHETYPE_RESOURCE
        2. pluginname_supports(FEATURE_MOD_INTRO) returning false
      2. Add an instance of the resource to a class
      3. Add the activities block to the class
      4. Click "Resources" on the activities block
      5. You should see no error message
      Show
      Find or create a mod plugin with: pluginname_supports(FEATURE_MOD_ARCHETYPE) returning MOD_ARCHETYPE_RESOURCE pluginname_supports(FEATURE_MOD_INTRO) returning false Add an instance of the resource to a class Add the activities block to the class Click "Resources" on the activities block You should see no error message
    • Affected Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE, MOODLE_25_STABLE, MOODLE_26_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE, MOODLE_25_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-36482_master

      Description

      Viewing the page /course/resources.php when you have a module which doesn't support FEATURE_MOD_INTRO on the course causes the following database error:

      Error reading from database
       
      More information about this error
      Debug info: Unknown column 'intro' in 'field list'
      SELECT id,name,intro,introformat,timemodified FROM mdl_printable WHERE id IN (?,?,?,?) ORDER BY id
      [array (
      0 => '392',
      1 => '391',
      2 => '390',
      3 => '393',
      )]
      Error code: dmlreadexception
      Stack trace:
       
          line 407 of /lib/dml/moodle_database.php: dml_read_exception thrown
          line 945 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
          line 1175 of /lib/dml/moodle_database.php: call to mysqli_native_moodle_database->get_records_sql()
          line 1148 of /lib/dml/moodle_database.php: call to moodle_database->get_records_select()
          line 90 of /course/resources.php: call to moodle_database->get_records_list()
      

      To reproduce this behaviour:

      1. Find or create a mod plugin with:
        1. pluginname_supports(FEATURE_MOD_ARCHETYPE) returning MOD_ARCHETYPE_RESOURCE
        2. pluginname_supports(FEATURE_MOD_INTRO) returning false
      2. Add an instance of the resource to a class
      3. Add the activities block to the class
      4. Click "Resources" on the activities block
      5. You should see the error message

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Votes:
                  0 Vote for this issue
                  Watchers:
                  7 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    8/Jul/13