Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-12166

accessallgroups does not work for reply forum posts in separate groups

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.8.2
    • 1.8.3, 1.9
    • Forum, Groups, Roles / Access
    • None
    • Any
    • MOODLE_18_STABLE
    • MOODLE_18_STABLE, MOODLE_19_STABLE

    Description

      An editing trainer in the course with capability "moodle/site:accessallgroups" set to ALLOWED is not able to reply to a forum post when the group mode of the forum is set to separate groups. Error "nopostdiscussion"

      Looking at the code in mod/forum/post.php, line 146 (Moodle version 1.8.2):

      $modcontext = get_context_instance(CONTEXT_MODULE, $forum->id);

      This record is not in the mdl_context table since this table does not contain the forum ID in the instanceid field but the forums course module ID; so the correct call should be:

      $cm = get_coursemodule_from_instance("forum", $forum->id, $course->id); - which returns the course module object of the forum
      $modcontext = get_context_instance(CONTEXT_MODULE, $cm->id);

      You will find this in post.php of Moodle 1.9, i.e. in Moodle 1.9 the code seems to be correct.

      Attachments

        Activity

          People

            dougiamas Martin Dougiamas
            ghillenb Gisela Hillenbrand
            Nobody Nobody
            Adrian Greeve, Ilya Tregubov, Kevin Percy, Mathew May, Mihail Geshoski, Shamim Rezaie, David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo, David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              11/Oct/07