From 6bf25708b62873cbe4278dfab8d332a57e9628a8 Mon Sep 17 00:00:00 2001 From: skodak Date: Mon, 5 Jan 2009 23:42:51 +0000 Subject: [PATCH] DML 2.0 regression --- backup/restore.php | 2 +- mod/chat/gui_header_js/chatinput.php | 4 ++-- mod/forum/lib.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/backup/restore.php b/backup/restore.php index ff4299cac0..b2c22cc228 100644 --- a/backup/restore.php +++ b/backup/restore.php @@ -24,7 +24,7 @@ $backup_unique_code = optional_param('backup_unique_code',0,PARAM_INT); //Get and check course - if (! $course = get_record("course", "id", $id)) { + if (! $course = $DB->get_record("course", array("id"=>$id))) { print_error('invalidcourseid'); } // To some reasons, course_startdateoffset value was lost during restoring diff --git a/mod/chat/gui_header_js/chatinput.php b/mod/chat/gui_header_js/chatinput.php index 6d1232c516..35599bf906 100644 --- a/mod/chat/gui_header_js/chatinput.php +++ b/mod/chat/gui_header_js/chatinput.php @@ -11,11 +11,11 @@ if (!$chatuser = $DB->get_record('chat_users', array('sid'=>$chat_sid))) { print_error('notlogged', 'chat'); } - if (!$chat = get_record('chat', 'id', $chatid)) { + if (!$chat = $DB->get_record('chat', array('id'=>$chatid))) { error('Could not find that chat room!'); } - if (!$course = get_record('course', 'id', $chat->course)) { + if (!$course = $DB->get_record('course', array('id'=>$chat->course))) { error('Could not find the course this belongs to!'); } diff --git a/mod/forum/lib.php b/mod/forum/lib.php index 2a3beae55a..6376f7052b 100644 --- a/mod/forum/lib.php +++ b/mod/forum/lib.php @@ -6851,7 +6851,7 @@ function forum_reset_userdata($data) { $DB->delete_records_select('forum_posts', "discussion IN ($discussionssql AND f.type <> 'single') AND parent = 0", $params); // now the initial posts for non single simple // finally all discussions except single simple forums - delete_records_select('forum_discussions', "forum IN ($forumssql AND f.type <> 'single')", $params); + $DB->delete_records_select('forum_discussions', "forum IN ($forumssql AND f.type <> 'single')", $params); // remove all grades from gradebook if (empty($data->reset_gradebook_grades)) { -- 2.39.5