Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Duplicate
    • Affects Version/s: 2.0.4
    • Fix Version/s: None
    • Component/s: Gradebook
    • Labels:
      None
    • Affected Branches:
      MOODLE_20_STABLE
    • Rank:
      38868

      Description

      I went to export grades to excel. After the settings screen appears, I click "Download" and the headings appear, but not the student names & grades. This is the error message:

      Debug info: Unknown column 'rainner.userid' in 'on clause'
      SELECT g.* , u.lastname AS usrt1, u.firstname AS usrt2, u.id AS usrt
      FROM mdl_grade_grades g
      JOIN mdl_user u ON g.userid = u.id
      JOIN (SELECT DISTINCT eu1_u.id
      FROM mdl_user eu1_u
      JOIN mdl_user_enrolments eu1_ue ON eu1_ue.userid = eu1_u.id
      JOIN mdl_enrol eu1_e ON (eu1_e.id = eu1_ue.enrolid AND eu1_e.courseid = ?)
      WHERE eu1_u.deleted = 0 AND eu1_u.id <> ?) je ON je.id = u.id

      JOIN (
      SELECT DISTINCT ra.userid
      FROM mdl_role_assignments ra
      WHERE ra.roleid IN (?,?)
      AND ra.contextid IN (168,3,1)
      ) rainnner ON rainner.userid = u.id
      WHERE u.deleted = 0
      AND g.itemid IN (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)

      ORDER BY usrt1 ASC, usrt2 ASC, usrt ASC, g.itemid ASC
      [array (
      0 => '4',
      1 => '1',
      2 => '3',
      3 => '5',
      4 => 40,
      5 => 44,
      6 => 46,
      7 => 50,
      8 => 51,
      9 => 55,
      10 => 56,
      11 => 63,
      12 => 67,
      13 => 72,
      14 => 76,
      15 => 77,
      16 => 80,
      17 => 81,
      18 => 87,
      19 => 88,
      20 => 93,
      21 => 97,
      22 => 101,
      23 => 102,
      24 => 106,
      25 => 107,
      26 => 108,
      27 => 109,
      28 => 12,
      )]
      Stack trace:
      line 391 of \lib\dml\moodle_database.php: dml_read_exception thrown
      line 749 of \lib\dml\mysqli_native_moodle_database.php: call to moodle_database->query_end()
      line 166 of \grade\lib.php: call to mysqli_native_moodle_database->get_recordset_sql()
      line 225 of \grade\export\lib.php: call to graded_users_iterator->init()
      line 59 of \grade\export\xls\index.php: call to grade_export->display_preview()

        Issue Links

          Activity

          Hide
          Michael de Raadt added a comment -

          Thanks for reporting that.

          The Excel writer is a bit of a beast, but I don't think it's the problem here.

          Could you let us know what DBMS you are using?

          Show
          Michael de Raadt added a comment - Thanks for reporting that. The Excel writer is a bit of a beast, but I don't think it's the problem here. Could you let us know what DBMS you are using?
          Hide
          Andrew Davis added a comment -

          Hello. This issue is a duplicate of MDL-27153. Due to some changes in our development process at the time I can tell you that that issue was fixed in April 2011 but I can't tell you what specific point release contained the fix.

          However, I can tell you that if you go to http://download.moodle.org/ and download the latest 2.0 version, currently 2.0.8, you will no longer encounter this error.

          Show
          Andrew Davis added a comment - Hello. This issue is a duplicate of MDL-27153 . Due to some changes in our development process at the time I can tell you that that issue was fixed in April 2011 but I can't tell you what specific point release contained the fix. However, I can tell you that if you go to http://download.moodle.org/ and download the latest 2.0 version, currently 2.0.8, you will no longer encounter this error.
          Hide
          Michael de Raadt added a comment -

          Thanks, Andrew.

          I searched for duplicates, but missed that one obviously.

          Show
          Michael de Raadt added a comment - Thanks, Andrew. I searched for duplicates, but missed that one obviously.

            People

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

              Dates

              • Created:
                Updated:
                Resolved: