Prevent Oracle to fail when inserting records with log->info empty

(will be solved once we got all those NOT NULL fields fixed)

Merged from MOODLE_17_STABLE
This commit is contained in:
stronk7
2006-10-30 19:53:40 +00:00
parent 8451166cfb
commit 8b497bbce3
+6
View 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')");