MDL-31753 Get correct course ID for Community finder search link.
authorTomasz Muras <nexor1984@gmail.com>
Thu, 23 Feb 2012 11:51:03 +0000 (11:51 +0000)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Tue, 7 Aug 2012 00:13:44 +0000 (02:13 +0200)
blocks/community/block_community.php

index c3071c4..35e3f2e 100644 (file)
@@ -71,7 +71,7 @@ class block_community extends block_list {
         $icon = html_writer::empty_tag('img', array('src' => $OUTPUT->pix_url('i/group'),
                     'class' => 'icon', 'alt' => get_string('addcourse', 'block_community')));
         $addcourseurl = new moodle_url('/blocks/community/communitycourse.php',
-                        array('add' => true, 'courseid' => $coursecontext->instanceid));
+                        array('add' => true, 'courseid' => $this->page->course->id));
         $searchlink = html_writer::tag('a', $icon . '&nbsp;' . get_string('addcourse', 'block_community'),
                         array('href' => $addcourseurl->out(false)));
         $this->content->items[] = $searchlink;
@@ -91,7 +91,7 @@ class block_community extends block_list {
                                     'alt' => get_string('removecommunitycourse', 'block_community')));
                 $deleteurl = new moodle_url('/blocks/community/communitycourse.php',
                                 array('remove' => true,
-                                    'courseid' => $coursecontext->instanceid,
+                                    'courseid' => $this->page->course->id,
                                     'communityid' => $course->id, 'sesskey' => sesskey()));
                 $deleteatag = html_writer::tag('a', $deleteicon, array('href' => $deleteurl));