Skip to content

Commit

Permalink
MDL-21676, fixed comment code
Browse files Browse the repository at this point in the history
  • Loading branch information
Dongsheng Cai committed Jul 5, 2010
1 parent e93b82d commit 2522800
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions comment/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ public function get_comments($page = '') {
$params = array();
$start = $page * $CFG->commentsperpage;
$ufields = user_picture::fields('u');
$sql = "SELECT $ufields, c.id AS cid, c.content AS c.content, c.format AS cformat, c.timecreated AS ctimecreated
$sql = "SELECT $ufields, c.id AS cid, c.content AS ccontent, c.format AS cformat, c.timecreated AS ctimecreated
FROM {comments} c
JOIN {user} u ON u.id = c.userid
WHERE c.contextid = :contextid AND c.commentarea = :commentarea AND c.itemid = :itemid
Expand All @@ -416,7 +416,7 @@ public function get_comments($page = '') {
$comments = array();
$candelete = has_capability('moodle/comment:delete', $this->context);
$rs = $DB->get_recordset_sql($sql, $params, $start, $CFG->commentsperpage);
foreach ($records as $u) {
foreach ($rs as $u) {
$c = new object();
$c->id = $u->cid;
$c->content = $u->ccontent;
Expand Down

0 comments on commit 2522800

Please sign in to comment.