Skip to content

Commit

Permalink
Merge branch 'master_MDL-32125_forum_subscription_change_reflected' o…
Browse files Browse the repository at this point in the history
…f git://github.com/kanikagoyal/moodle
  • Loading branch information
Sam Hemelryk committed Sep 12, 2012
2 parents fd9a54c + cf3b905 commit 36b76c1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions mod/forum/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,14 @@ function forum_update_instance($forum, $mform) {

$DB->update_record('forum', $forum);

$modcontext = get_context_instance(CONTEXT_MODULE, $forum->coursemodule);
if (($forum->forcesubscribe == FORUM_INITIALSUBSCRIBE) && ($oldforum->forcesubscribe <> $forum->forcesubscribe)) {
$users = forum_get_potential_subscribers($modcontext, 0, 'u.id, u.email', '');
foreach ($users as $user) {
forum_subscribe($user->id, $forum->id);
}
}

forum_grade_item_update($forum);

return true;
Expand Down

0 comments on commit 36b76c1

Please sign in to comment.