Unverified Commit 702b8f1a authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3010378 by benjifisher, piotrkonefal: BookManager::buildItems() is slow...

Issue #3010378 by benjifisher, piotrkonefal: BookManager::buildItems() is slow because it loads nodes
parent 952e9390
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -587,8 +587,7 @@ protected function buildItems(array $tree) {
      // Allow book-specific theme overrides.
      $element['attributes'] = new Attribute();
      $element['title'] = $data['link']['title'];
      $node = $this->entityTypeManager->getStorage('node')->load($data['link']['nid']);
      $element['url'] = $node->toUrl();
      $element['url'] = 'entity:node/' . $data['link']['nid'];
      $element['localized_options'] = !empty($data['link']['localized_options']) ? $data['link']['localized_options'] : [];
      $element['localized_options']['set_active_class'] = TRUE;
      $element['below'] = $data['below'] ? $this->buildItems($data['below']) : [];