diff --git a/mod/forum/db/upgrade.php b/mod/forum/db/upgrade.php index ec874dfa7ee..c7248d31979 100644 --- a/mod/forum/db/upgrade.php +++ b/mod/forum/db/upgrade.php @@ -242,6 +242,13 @@ function xmldb_forum_upgrade($oldversion) { // Moodle v2.9.0 release upgrade line. // Put any upgrade step following this. + if ($oldversion < 2015051102) { + // Groupid = 0 is never valid. + $DB->set_field('forum_discussions', 'groupid', -1, array('groupid' => 0)); + + // Forum savepoint reached. + upgrade_mod_savepoint(true, 2015051102, 'forum'); + } return true; } diff --git a/mod/forum/tests/behat/separate_group_discussions.feature b/mod/forum/tests/behat/separate_group_discussions.feature index 2a99b8c4ef9..30e5b506924 100644 --- a/mod/forum/tests/behat/separate_group_discussions.feature +++ b/mod/forum/tests/behat/separate_group_discussions.feature @@ -239,3 +239,16 @@ Feature: Posting to all groups in a separate group discussion is restricted to u And the "Group" select box should contain "Group A" And the "Group" select box should contain "Group B" And I should see "Post a copy to all groups" + + Scenario: Students can view all participants discussions in separate groups mode + Given I log in as "teacher1" + And I follow "Course 1" + When I add a new discussion to "Standard forum name" forum with: + | Subject | Forum post to all participants | + | Message | This is the body | + | Group | All participants | + And I log out + And I log in as "student1" + And I follow "Course 1" + And I follow "Standard forum name" + Then I should see "Forum post to all participants" diff --git a/mod/forum/version.php b/mod/forum/version.php index 2caf094cb05..b6c95cfb4bc 100644 --- a/mod/forum/version.php +++ b/mod/forum/version.php @@ -24,6 +24,6 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2015051101; // The current module version (Date: YYYYMMDDXX) +$plugin->version = 2015051102; // The current module version (Date: YYYYMMDDXX) $plugin->requires = 2015050500; // Requires this Moodle version $plugin->component = 'mod_forum'; // Full name of the plugin (used for diagnostics)