MDL-14679 fixed a lot more old style uses of insert_record()

This commit is contained in:
Petr Skoda
2010-09-03 17:47:41 +00:00
parent b44ff4e45b
commit a9637e7df4
15 changed files with 233 additions and 327 deletions
+4 -8
View File
@@ -99,18 +99,14 @@ function note_save(&$note) {
if (empty($note->id)) {
// insert new note
$note->created = $note->lastmodified;
if ($id = $DB->insert_record('post', $note)) {
$note = $DB->get_record('post', array('id'=>$id));
$result = true;
} else {
$result = false;
}
$id = $DB->insert_record('post', $note);
$note = $DB->get_record('post', array('id'=>$id));
} else {
// update old note
$result = $DB->update_record('post', $note);
$DB->update_record('post', $note);
}
unset($note->module);
return $result;
return true;
}
/**