From be52d0daced2b85d7fcb6d0df18bb1081da1c423 Mon Sep 17 00:00:00 2001 From: John Okely Date: Fri, 27 Jan 2017 14:59:33 +0800 Subject: [PATCH] MDL-37168 grade: Debugging if gradebook callbacks are not both present --- lib/gradelib.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/gradelib.php b/lib/gradelib.php index 2417784bb9f..aa16239f80b 100644 --- a/lib/gradelib.php +++ b/lib/gradelib.php @@ -1379,9 +1379,10 @@ function grade_update_mod_grades($modinstance, $userid=0) { //new grading supported, force updating of grades $updateitemfunc($modinstance); $updategradesfunc($modinstance, $userid); - - } else { + } else if (function_exists($updategradesfunc) xor function_exists($updateitemfunc)) { // Module does not support grading? + debugging("You have declared one of $updateitemfunc and $updategradesfunc but not both. " . + "This will cause broken behaviour.", DEBUG_DEVELOPER); } return true;