Merge branch 'MOODLE_38_STABLE-MDL-67524' of https://github.com/yao9394/moodle into MOODLE_38_STABLE
This commit is contained in:
@@ -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"
|
||||
|
||||
+2
-2
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user