Skip to content

Commit

Permalink
MDL-37449 Incorrect doubled 'u.email' field in the SQL query (Oracle …
Browse files Browse the repository at this point in the history
…error: ORA-00918)
  • Loading branch information
scara committed Feb 15, 2013
1 parent 09de5eb commit 9b64858
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion mod/scorm/report/basic/report.php
Expand Up @@ -34,6 +34,7 @@ class scorm_basic_report extends scorm_default_report {
*/
function display($scorm, $cm, $course, $download) {
global $CFG, $DB, $OUTPUT, $PAGE;

$contextmodule= context_module::instance($cm->id);
$action = optional_param('action', '', PARAM_ALPHA);
$attemptids = optional_param_array('attemptid', array(), PARAM_RAW);
Expand Down Expand Up @@ -271,7 +272,7 @@ function display($scorm, $cm, $course, $download) {
$select = 'SELECT DISTINCT '.$DB->sql_concat('u.id', '\'#\'', 'COALESCE(st.attempt, 0)').' AS uniqueid, ';
$select .= 'st.scormid AS scormid, st.attempt AS attempt, ' .
'u.id AS userid, u.idnumber, u.firstname, u.lastname, u.picture, u.imagealt, u.email' .
get_extra_user_fields_sql($coursecontext, 'u', '', array('idnumber')) . ' ';
get_extra_user_fields_sql($coursecontext, 'u', '', array('email', 'idnumber')) . ' ';

// This part is the same for all cases - join users and scorm_scoes_track tables
$from = 'FROM {user} u ';
Expand Down
3 changes: 2 additions & 1 deletion mod/scorm/report/interactions/report.php
Expand Up @@ -35,6 +35,7 @@ class scorm_interactions_report extends scorm_default_report {
*/
function display($scorm, $cm, $course, $download) {
global $CFG, $DB, $OUTPUT, $PAGE;

$contextmodule = context_module::instance($cm->id);
$action = optional_param('action', '', PARAM_ALPHA);
$attemptids = optional_param_array('attemptid', array(), PARAM_RAW);
Expand Down Expand Up @@ -159,7 +160,7 @@ function display($scorm, $cm, $course, $download) {
$select = 'SELECT DISTINCT '.$DB->sql_concat('u.id', '\'#\'', 'COALESCE(st.attempt, 0)').' AS uniqueid, ';
$select .= 'st.scormid AS scormid, st.attempt AS attempt, ' .
'u.id AS userid, u.idnumber, u.firstname, u.lastname, u.picture, u.imagealt, u.email'.
get_extra_user_fields_sql($coursecontext, 'u', '', array('idnumber')) . ' ';
get_extra_user_fields_sql($coursecontext, 'u', '', array('email', 'idnumber')) . ' ';

// This part is the same for all cases - join users and scorm_scoes_track tables
$from = 'FROM {user} u ';
Expand Down

0 comments on commit 9b64858

Please sign in to comment.