Skip to content

Commit d634eb6

Browse files
committed
Add protection against the case where there are no grades that need updating.
1 parent e8dbb2e commit d634eb6

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

locallib.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
require_once("$CFG->dirroot/calendar/lib.php");
55

66
define('WWASSIGNMENT_DEBUG',0);
7-
// define('WWASSIGNMENT_DEBUG',1);
7+
//define('WWASSIGNMENT_DEBUG',1);
88
define('WWASSIGNMENT_TRACE',0);
99
//define('WWASSIGNMENT_TRACE',1);
1010

@@ -366,7 +366,14 @@ function _wwassignment_update_dirty_sets() { // update grades for all instances
366366
// //list($insql,$inparams) = $DB->get_in_or_equal($idValues,SQL_PARAMS_NAMED);
367367
$arraykeys = array_keys($wwmodtimes);
368368
// //debugLog("array_keys ".print_r($arraykeys,true));
369+
if (count( $arraykeys)==0) {
370+
traceLog("-----------------no grades to update -------------------------------");
371+
traceLog("-----------------End _wwassignment_update_dirty_sets---------------");
372+
return true;
373+
}
374+
traceLog("------ find arraykeys in SQL_PARAMs_NAMEd");
369375
list($insql,$inparams) = $DB->get_in_or_equal($arraykeys,SQL_PARAMS_NAMED);
376+
370377
// //list($insql, $inparams) = $DB->get_in_or_equal($wwmodtimes,SQL_PARAMS_NAMED);
371378
// debugLog("values string: $idValues");
372379
// debugLog("last modification times".print_r($wwmodtimes,true));

0 commit comments

Comments
 (0)