Permalink
Browse files

MDL-32125 mod_forum: updating subscription mode not reflected

  • Loading branch information...
1 parent 77ef5e0 commit b4271570c60f54f411d389de368079bca47b6de3 @kanikagoyal kanikagoyal committed with Sam Hemelryk Apr 2, 2012
Showing with 7 additions and 0 deletions.
  1. +7 −0 mod/forum/lib.php
View
@@ -216,6 +216,13 @@ 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;

0 comments on commit b427157

Please sign in to comment.