MDL-37687 use $SITE to allow non-logged-in users to browse comment via ajax
authorAparup Banerjee <aparup@moodle.com>
Tue, 12 Feb 2013 08:19:40 +0000 (16:19 +0800)
committerAparup Banerjee <aparup@moodle.com>
Tue, 12 Feb 2013 08:19:40 +0000 (16:19 +0800)
comment/comment_ajax.php

index 91b99ca..131a803 100644 (file)
@@ -35,6 +35,10 @@ if (empty($CFG->usecomments)) {
 
 list($context, $course, $cm) = get_context_info_array($contextid);
 
+if ( $contextid == SYSCONTEXTID ) {
+    $course = $SITE;
+}
+
 $PAGE->set_url('/comment/comment_ajax.php');
 
 // Allow anonymous user to view comments providing forcelogin now enabled