Permalink
Browse files

MDL-33398 completion: Fix coding error (should be arrays not objects)

  • Loading branch information...
1 parent ba459c4 commit 28e0b61cd0f0f463bb5b10b702bd1e048ee7fcbb Aaron Barnes committed May 29, 2012
@@ -229,7 +229,7 @@ public function cron() {
// Loop through completions, and mark as complete
$rs = $DB->get_recordset_sql($sql);
foreach ($rs as $record) {
- $completion = new completion_criteria_completion($record, DATA_OBJECT_FETCH_BY_KEY);
+ $completion = new completion_criteria_completion((array) $record, DATA_OBJECT_FETCH_BY_KEY);
$completion->mark_complete($record->timecompleted);
}
$rs->close();
@@ -189,7 +189,7 @@ public function cron() {
// Loop through completions, and mark as complete
$rs = $DB->get_recordset_sql($sql);
foreach ($rs as $record) {
- $completion = new completion_criteria_completion($record, DATA_OBJECT_FETCH_BY_KEY);
+ $completion = new completion_criteria_completion((array) $record, DATA_OBJECT_FETCH_BY_KEY);
$completion->mark_complete($record['timecompleted']);
}
$rs->close();
@@ -179,7 +179,7 @@ public function cron() {
// Loop through completions, and mark as complete
$rs = $DB->get_recordset_sql($sql, array(time()));
foreach ($rs as $record) {
- $completion = new completion_criteria_completion($record, DATA_OBJECT_FETCH_BY_KEY);
+ $completion = new completion_criteria_completion((array) $record, DATA_OBJECT_FETCH_BY_KEY);
$completion->mark_complete($record['timeend']);
}
$rs->close();
@@ -225,7 +225,7 @@ public function cron() {
$now = time();
$rs = $DB->get_recordset_sql($sql, array($now, $now));
foreach ($rs as $record) {
- $completion = new completion_criteria_completion($record, DATA_OBJECT_FETCH_BY_KEY);
+ $completion = new completion_criteria_completion((array) $record, DATA_OBJECT_FETCH_BY_KEY);
// Use time start if not 0, otherwise use timeenrolled
if ($record->otimestart) {
@@ -215,7 +215,7 @@ public function cron() {
// Loop through completions, and mark as complete
$rs = $DB->get_recordset_sql($sql);
foreach ($rs as $record) {
- $completion = new completion_criteria_completion($record, DATA_OBJECT_FETCH_BY_KEY);
+ $completion = new completion_criteria_completion((array) $record, DATA_OBJECT_FETCH_BY_KEY);
$completion->mark_complete($record['timecompleted']);
}
$rs->close();

0 comments on commit 28e0b61

Please sign in to comment.