Issue #2208325 by mcjim, anksy: Incorrect error message when changing the outline of a book page.
parent
797c8de16b
commit
16fb258c95
|
@ -818,6 +818,7 @@ class BookManager implements BookManagerInterface {
|
||||||
foreach ($affected_bids as $bid) {
|
foreach ($affected_bids as $bid) {
|
||||||
\Drupal::cache('data')->deleteTags(array('bid' => $bid));
|
\Drupal::cache('data')->deleteTags(array('bid' => $bid));
|
||||||
}
|
}
|
||||||
|
return $link;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -585,4 +585,24 @@ class BookTest extends WebTestBase {
|
||||||
$this->assertOptionSelected('edit-book-bid', $node->id());
|
$this->assertOptionSelected('edit-book-bid', $node->id());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tests that saveBookLink() returns something.
|
||||||
|
*/
|
||||||
|
public function testSaveBookLink() {
|
||||||
|
$book_manager = \Drupal::service('book.manager');
|
||||||
|
|
||||||
|
// Mock a link for a new book.
|
||||||
|
$link = array('nid' => 1, 'has_children' => 0, 'original_bid' => 0, 'parent_depth_limit' => 8, 'pid' => 0, 'weight' => 0, 'bid' => 1);
|
||||||
|
$new = TRUE;
|
||||||
|
|
||||||
|
// Save the link.
|
||||||
|
$return = $book_manager->saveBookLink($link, $new);
|
||||||
|
|
||||||
|
// Add the link defaults to $link so we have something to compare to the return from saveBookLink().
|
||||||
|
$link += $book_manager->getLinkDefaults($link['nid']);
|
||||||
|
|
||||||
|
// Test the return from saveBookLink.
|
||||||
|
$this->assertEqual($return, $link);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue