Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'm22_MDL-32125_forum_subscription_change_reflected' of g…

…it://github.com/kanikagoyal/moodle into MOODLE_22_STABLE
  • Loading branch information...
commit 04ec524d74dd1463d7fd053faf9c9123bca4a7cb 2 parents b7367b9 + 6a5e3c1
@samhemelryk samhemelryk authored
Showing with 8 additions and 0 deletions.
  1. +8 −0 mod/forum/lib.php
View
8 mod/forum/lib.php
@@ -209,6 +209,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;
Please sign in to comment.
Something went wrong with that request. Please try again.