Skip to content

Commit

Permalink
fixed github issue #5 (bad integer cast in SQL query for block recent…
Browse files Browse the repository at this point in the history
… activity)
  • Loading branch information
patrickpollet committed Nov 13, 2014
1 parent bb7f088 commit b54118b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion mass_enroll.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,11 @@
echo $OUTPUT->continue_button($PAGE->url); // Back to this page
echo $OUTPUT->footer($course);
//path must be relative to 'module name', here 'course'
add_to_log($course->id, 'course', 'enrol', '../local/mass_enroll/mass_enroll.php?id='.$course->id,$strinscriptions);
//add_to_log($course->id, 'course', 'enrol', '../local/mass_enroll/mass_enroll.php?id='.$course->id,$strinscriptions);
// Rev 12/11/2014 : some core function (get_recent_enrolments()) expect the info field of log record to be integer
// when action field is 'enrol'. This produced fatal SQL errors with PostGres see https://github.com/patrickpollet/moodle_local_mass_enroll/issues/5
// so we changed action value from 'enrol' to 'massenrol'
add_to_log($course->id, 'course', 'massenrol', '../local/mass_enroll/mass_enroll.php?id='.$course->id,$strinscriptions);


die();
Expand Down
6 changes: 5 additions & 1 deletion mass_unenroll.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,11 @@
echo $OUTPUT->continue_button($PAGE->url); // Back to this page
echo $OUTPUT->footer($course);
//path must be relative to 'module name', here 'course'
add_to_log($course->id, 'course', 'unenrol', '../local/mass_enroll/mass_unenroll.php?id='.$course->id,$strinscriptions);
// Rev 12/11/2014 : some core function (get_recent_enrolments()) expect the info field of log record to be integer
// when action field is 'enrol'. This produced fatal SQL errors with PostGres see https://github.com/patrickpollet/moodle_local_mass_enroll/issues/5
// so we changed action value from 'enrol' to 'massunenrol'
//add_to_log($course->id, 'course', 'unenrol', '../local/mass_enroll/mass_unenroll.php?id='.$course->id,$strinscriptions);
add_to_log($course->id, 'course', 'massunenrol', '../local/mass_enroll/mass_unenroll.php?id='.$course->id,$strinscriptions);

die();
}
Expand Down

0 comments on commit b54118b

Please sign in to comment.