From 8eed94e2f07e6da72fc57fa291e61a13906648cd Mon Sep 17 00:00:00 2001 From: dongsheng Date: Wed, 15 Oct 2008 09:03:30 +0000 Subject: [PATCH] "MDL-11371, The View past chat sessions should not appear if there haven't been any." --- mod/chat/view.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mod/chat/view.php b/mod/chat/view.php index 2d834325aa..4d1dfdf972 100644 --- a/mod/chat/view.php +++ b/mod/chat/view.php @@ -113,13 +113,15 @@ groups_print_activity_menu($cm, "view.php?id=$cm->id"); if ($currentgroup) { + $groupselect = " AND groupid = '$currentgroup'"; $groupparam = "&groupid=$currentgroup"; } else { + $groupselect = ""; $groupparam = ""; } if ($chat->studentlogs or has_capability('mod/chat:readlog',$context)) { - if ($msg = get_records_select('chat_messages', "chatid = '$chat->id' $groupselect", '', 'id', '', 1)) { + if ($msg = $DB->get_records_select('chat_messages', "chatid = ? $groupselect", array($chat->id))) { echo '