diff --git a/core/modules/book/src/BookManager.php b/core/modules/book/src/BookManager.php index 2953c42..9de463c 100644 --- a/core/modules/book/src/BookManager.php +++ b/core/modules/book/src/BookManager.php @@ -990,19 +990,14 @@ protected function doBookTreeCheckAccess(&$tree) { * {@inheritdoc} */ public function bookLinkTranslate(&$link) { - $node = NULL; - // Check access via the api, since the query node_access tag doesn't - // check for unpublished nodes. + // Check access via the api, since the query node_access tag doesn't check + // for unpublished nodes. + // @todo - load the nodes en-mass rather than individually. $node = $this->entityManager->getStorage('node')->load($link['nid']); $link['access'] = $node && $node->access('view'); // For performance, don't localize a link the user can't access. if ($link['access']) { - // @todo - load the nodes en-mass rather than individually. - if (!$node) { - $node = $this->entityManager->getStorage('node') - ->load($link['nid']); - } // The node label will be the value for the current user's language. $link['title'] = $node->label(); $link['options'] = [];