Merge branch 'master-MDL-67524' of https://github.com/yao9394/moodle

This commit is contained in:
Adrian Greeve 2019-12-23 10:28:50 +08:00
commit bd287fa694
2 changed files with 7 additions and 7 deletions

View File

@ -58,11 +58,6 @@ Feature: Book activity chapter visibility management
And I follow "Test book"
Then the "class" attribute of "a[title='Second chapter']" "css_element" should contain "dimmed_text"
And the "class" attribute of "a[title='Third chapter']" "css_element" should contain "dimmed_text"
And I follow "Next"
And I should see "Fourth chapter" in the ".book_content" "css_element"
And I follow "Exit book"
And I follow "Test book"
And I should see "First chapter" in the ".book_content" "css_element"
And I turn editing mode on
And I follow "Next"
And I should see "Second chapter" in the ".book_content" "css_element"
@ -80,3 +75,8 @@ Feature: Book activity chapter visibility management
And I follow "Test book"
And I should not see "Second chapter" in the "Table of contents" "block"
And I should not see "Third chapter" in the "Table of contents" "block"
And I follow "Next"
And I should see "Fourth chapter" in the ".book_content" "css_element"
And I follow "Exit book"
And I follow "Test book"
And I should see "First chapter" in the ".book_content" "css_element"

View File

@ -80,7 +80,7 @@ if ($chapterid == '0') { // Go to first chapter if no given.
book_view($book, null, false, $course, $cm, $context);
foreach ($chapters as $ch) {
if ($edit) {
if ($edit || ($ch->hidden && $viewhidden)) {
$chapterid = $ch->id;
break;
}
@ -132,7 +132,7 @@ $nexttitle = null;
$navnexttitle = null;
$last = null;
foreach ($chapters as $ch) {
if (!$edit and $ch->hidden) {
if (!$edit and ($ch->hidden && !$viewhidden)) {
continue;
}
if ($last == $chapter->id) {