Moodle

Teachers cannot post to forums if not in correct group

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.8.3
  • Fix Version/s: 1.8.4
  • Component/s: Forum, Groups
  • Labels:
    None
  • Database:
    Any
  • Affected Branches:
    MOODLE_18_STABLE
  • Fixed Branches:
    MOODLE_18_STABLE

Description

Teachers, both editing and non-, are not able to reply to messages that have been posted by a member of a group, if the teacher is not a member of the same group. The teacher gets a "[[nopostdiscussion]]" error in this case.

There is a bug on line 147:

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

should be:

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

Furthermore, this line needs to be moved inside the 'if' block on line 159, so that $cm is actually defined.

This error has been reported elsewhere, specifically MDL-11304 where it is reported as fixed - but it does not appear to be so in MOODLE_18_STABLE.

The attached patch fixes the issue, and also patches the bug reported in MDL-10664.

Activity

Hide
Petr Škoda (skodak) added a comment -

somebody fixed it already, thanks for the report.

Show
Petr Škoda (skodak) added a comment - somebody fixed it already, thanks for the report.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: