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

Error accessing the SCORM Basic Report: "ORA-00918: column ambiguously defined"

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.4
    • Fix Version/s: 2.3.5, 2.4.2
    • Component/s: SCORM
    • Labels:
    • Database:
      Oracle
    • Testing Instructions:
      Hide

      With Oracle (That means you, Moodle HQ, we should be testing oracle )

      1. Create a SCORM Activity
      2. Attend to it
      3. As a user with enough privileges click on both the Basic and Interactions reports
      4. Check that you can view the report and no sql error is seen

      Without Oracle (and as extra check with oracle): (Difficulty: developer, requires a code hack to look at the queries to overcome the lack of an Oracle based Moodle instance)

      1. Add $DB->set_debug(true); as described in https://moodle.org/mod/forum/discuss.php?d=222153#p966855
      2. Create a SCORM Activity
      3. Attend to it
      4. As a user with enough privileges click on both the Basic and Interactions reports
      5. Check that the offending SQL query has no more the doubled u.email
      Show
      With Oracle (That means you, Moodle HQ, we should be testing oracle ) Create a SCORM Activity Attend to it As a user with enough privileges click on both the Basic and Interactions reports Check that you can view the report and no sql error is seen Without Oracle (and as extra check with oracle): (Difficulty: developer, requires a code hack to look at the queries to overcome the lack of an Oracle based Moodle instance) Add $DB->set_debug(true); as described in https://moodle.org/mod/forum/discuss.php?d=222153#p966855 Create a SCORM Activity Attend to it As a user with enough privileges click on both the Basic and Interactions reports Check that the offending SQL query has no more the doubled u.email
    • Workaround:
      Hide

      Go to Site administration ► Users ► Permissions ► User policies and uncheck Email address in Show user identity (showuseridentity)

      Show
      Go to Site administration ► Users ► Permissions ► User policies and uncheck Email address in Show user identity ( showuseridentity )
    • Affected Branches:
      MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      m25_MDL-37449_Reports_ORA-00918_column_ambiguously_defined

      Description

      mod/scorm/report.php?id=70

      Debug info: ORA-00918: column ambiguously defined
      SELECT *
      FROM (SELECT DISTINCT u.id || '#' || COALESCE(st.attempt, 0) AS uniqueid, st.scormid AS scormid, st.attempt AS attempt, u.id AS userid, u.idnumber, u.firstname, u.lastname, u.picture, u.imagealt, u.email, u.email FROM m_user u LEFT JOIN m_scorm_scoes_track st ON st.userid = u.id AND st.scormid = 1 WHERE u.id IN (:o_param14,:o_param15,:o_param16,:o_param17) AND (st.userid IS NOT NULL OR st.userid IS NULL) ORDER BY uniqueid)
      WHERE rownum <= :o_oracle_num_rows
      [array (
      'o_param14' => 23,
      'o_param15' => 22,
      'o_param16' => 25,
      'o_param17' => 24,
      'o_oracle_num_rows' => 20,
      )]
      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 1101 of /lib/dml/oci_native_moodle_database.php: call to oci_native_moodle_database->query_end()
      line 345 of /mod/scorm/report/basic/report.php: call to oci_native_moodle_database->get_records_sql()
      line 85 of /mod/scorm/report.php: call to scorm_basic_report->display()

        Gliffy Diagrams

          Attachments

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  11/Mar/13