diff --git a/course/format/social/format.php b/course/format/social/format.php index 17d46f8dee39d..f9cb7228c0179 100644 --- a/course/format/social/format.php +++ b/course/format/social/format.php @@ -33,7 +33,8 @@ $numdiscussions = course_get_format($course)->get_course()->numdiscussions; if ($numdiscussions < 1) { - $numdiscussions = 1; // Make sure that the value is at least zero. + // Make sure that the value is at least one. + $numdiscussions = 1; } forum_print_latest_discussions($course, $forum, $numdiscussions, 'plain', '', false); diff --git a/course/format/social/lang/en/format_social.php b/course/format/social/lang/en/format_social.php index fdbf20f8cb101..ce6963ebb5f34 100644 --- a/course/format/social/lang/en/format_social.php +++ b/course/format/social/lang/en/format_social.php @@ -24,6 +24,6 @@ */ $string['numberdiscussions'] = 'Number of discussions'; -$string['numberdiscussions_help'] = 'This setting specifies how many discussions should be dispalyed.'; +$string['numberdiscussions_help'] = 'This setting specifies how many discussions should be displayed.'; $string['pluginname'] = 'Social format'; $string['sectionname'] = 'section'; diff --git a/course/format/social/tests/behat/social_adjust_discussion_count.feature b/course/format/social/tests/behat/social_adjust_discussion_count.feature index 533c2b06faef8..3ac6e65ca340c 100644 --- a/course/format/social/tests/behat/social_adjust_discussion_count.feature +++ b/course/format/social/tests/behat/social_adjust_discussion_count.feature @@ -92,7 +92,8 @@ Scenario: When number of discussions is decreased fewer discussions appear And I set the following fields to these values: | numdiscussions | 5 | When I press "Save and display" - Then I should see "This is forum post five" + Then I should see "This is forum post one" + And I should see "This is forum post five" And I should not see "This is forum post six" Scenario: When number of discussions is decreased to less than 1 only 1 discussion should appear @@ -102,12 +103,14 @@ Scenario: When number of discussions is decreased to less than 1 only 1 discussi When I press "Save and display" Then I should see "This is forum post one" And I should not see "This is forum post two" + And I should not see "This is forum post ten" Scenario: When number of discussions is increased more discussions appear Given I click on "Edit settings" "link" in the "Administration" "block" And I set the following fields to these values: | numdiscussions | 9 | When I press "Save and display" - Then I should see "This is forum post five" + Then I should see "This is forum post one" + And I should see "This is forum post five" And I should see "This is forum post nine" - And I should not see "This is forum post ten" \ No newline at end of file + And I should not see "This is forum post ten"