diff --git a/core/modules/book/src/BookManager.php b/core/modules/book/src/BookManager.php index c7059cd..e0587c3 100644 --- a/core/modules/book/src/BookManager.php +++ b/core/modules/book/src/BookManager.php @@ -719,7 +719,6 @@ public function saveBookLink(array $link, $new) { $link += $this->getLinkDefaults($link['nid']); if ($new) { // Insert new. - $link += $this->getBookParents($link, (array) $this->loadBookLink($link['pid'], FALSE)); $parents = $this->getBookParents($link, (array) $this->loadBookLink($link['pid'], FALSE)); $this->bookStorage->insert($link, $parents); diff --git a/core/modules/book/tests/src/BookManagerTest.php b/core/modules/book/tests/src/BookManagerTest.php index f7bd248..7fcdaff 100644 --- a/core/modules/book/tests/src/BookManagerTest.php +++ b/core/modules/book/tests/src/BookManagerTest.php @@ -56,6 +56,13 @@ class BookManagerTest extends UnitTestCase { protected $bookManager; /** + * Book Storage. + * + * @var BookStorageInterface + */ + protected $bookStorage; + + /** * {@inheritdoc} */ public static function getInfo() { @@ -76,7 +83,8 @@ protected function setUp() { $this->entityManager = $this->getMock('Drupal\Core\Entity\EntityManagerInterface'); $this->translation = $this->getStringTranslationStub(); $this->configFactory = $this->getConfigFactoryStub(array()); - $this->bookManager = new BookManager($this->connection, $this->entityManager, $this->translation, $this->configFactory); + $this->bookStorage = $this->getMock('Drupal\book\BookStorageInterface'); + $this->bookManager = new BookManager($this->connection, $this->entityManager, $this->translation, $this->configFactory, $this->bookStorage); } /**