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

ORA-00918 in hotpot reporting

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.4.8
    • Fix Version/s: 2.3.9, 2.4.6, 2.5.2, 2.6
    • Component/s: Module: HotPot
    • Labels:
      None
    • Plugin Version:
      2014.02.10 (00)
    • Affected Branches:
      MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE, MOODLE_25_STABLE, MOODLE_26_STABLE

      Description

      When entering report overview (/mod/hotpot/report.php?id=x&mode=overview), we get the following error (with the Debugging developer activated):

      Debug info: ORA-00918: column ambiguously defined
      SELECT *
      FROM (SELECT
      ha.*, (ha.timemodified - ha.timestart) AS duration, (CASE WHEN gg.rawgrade IS NULL THEN 0 ELSE ROUND(gg.rawgrade, 0) END) AS grade, u.id AS userid,u.picture,u.firstname,u.lastname,u.imagealt,u.email
      FROM m2hotpot_attempts ha INNER JOIN m2user u ON ha.userid = u.id LEFT JOIN m2grade_items gi ON gi.courseid = :o_courseid AND gi.itemtype = :o_itemtype AND gi.itemmodule = :o_itemmodule AND gi.iteminstance = :o_iteminstance LEFT JOIN m2grade_grades gg ON gg.itemid = gi.id AND gg.userid = ha.userid
      WHERE ha.hotpotid=:o_hotpotid AND ha.userid=u.id
      ORDER BY u.firstname, u.lastname, ha.attempt ASC)
      WHERE rownum <= :o_oracle_num_rows
      [array (
      'o_courseid' => '42',
      'o_itemtype' => 'mod',
      'o_itemmodule' => 'hotpot',
      'o_iteminstance' => '801',
      'o_hotpotid' => '801',
      'o_oracle_num_rows' => 30,
      )]
      Error code: dmlreadexception
      Stack trace:
      line 426 of /lib/dml/moodle_database.php: dml_read_exception thrown
      line 274 of /lib/dml/oci_native_moodle_database.php: call to moodle_database->query_end()
      line 1119 of /lib/dml/oci_native_moodle_database.php: call to oci_native_moodle_database->query_end()
      line 1422 of /lib/tablelib.php: call to oci_native_moodle_database->get_records_sql()
      line 162 of /mod/hotpot/report/renderer.php: call to table_sql->query_db()
      line 98 of /mod/hotpot/report/renderer.php: call to mod_hotpot_report_renderer->reportcontent()
      line 93 of /mod/hotpot/report.php: call to mod_hotpot_report_renderer->render_report()
      

      We've Moodle 2.4.8 and Oracle.
      To fix this problem we've edited the mod/hotpot/report/renderer.php file and, in the function select_sql, we've changed the following line (346):

      $userfields = ', '.$this->get_userfields('u', null, 'userid');
      

      by this other:

      $userfields = ', '.$this->get_userfields('u', null, 'userid2');
      

      because the problem is the ha.userid column which also is defined as u.userid.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                xxxxxxx Gordon Bateson
                Reporter:
                pferre22 Pau Ferrer
                Participants:
                Component watchers:
                Gordon Bateson
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  9/Sep/13