From 7a5b1fc555b9ff3da907cdcd49fae1e7d0fd1e91 Mon Sep 17 00:00:00 2001 From: patrickslee Date: Mon, 18 Jul 2005 22:21:56 +0000 Subject: [PATCH] Fixed when $cm is NULL, postgres still reports error. --- lib/datalib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/datalib.php b/lib/datalib.php index ea873fb16f3..47b48adb83c 100644 --- a/lib/datalib.php +++ b/lib/datalib.php @@ -2678,7 +2678,7 @@ function add_to_log($courseid, $module, $action, $url='', $info='', $cm=0, $user global $db, $CFG, $USER; - if ($cm === '') { // postgres won't translate empty string to its default + if ($cm === '' || is_null($cm)) { // postgres won't translate empty string to its default $cm = 0; }