]> git.mjollnir.org Git - moodle.git/commitdiff
Prevent Oracle to fail when inserting records with log->info empty
authorstronk7 <stronk7>
Mon, 30 Oct 2006 19:53:40 +0000 (19:53 +0000)
committerstronk7 <stronk7>
Mon, 30 Oct 2006 19:53:40 +0000 (19:53 +0000)
(will be solved once we got all those NOT NULL fields fixed)

Merged from MOODLE_17_STABLE

lib/datalib.php

index 1f1a576a845560e2b7e3da8b6c4a08cbbefa011d..877e2b14604a583a12aeaaf0bd64812356a0f79f 100644 (file)
@@ -1292,6 +1292,12 @@ function add_to_log($courseid, $module, $action, $url='', $info='', $cm=0, $user
 
     if (defined('MDL_PERFDB')) { global $PERF ; $PERF->dbqueries++; $PERF->logwrites++;};
 
+    if ($CFG->type = 'oci8po') {
+        if (empty($info)) {
+            $info = ' ';
+        }
+    }
+
     $result = $db->Execute('INSERT INTO '. $CFG->prefix .'log (time, userid, course, ip, module, cmid, action, url, info)
         VALUES (' . "'$timenow', '$userid', '$courseid', '$REMOTE_ADDR', '$module', '$cm', '$action', '$url', '$info')");