Unverified Commit 0537629f authored by alexpott's avatar alexpott
Browse files

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

Issue #3010378 by benjifisher, piotrkonefal: BookManager::buildItems() is slow because it loads nodes

(cherry picked from commit 702b8f1a)
parent 8a1fbabe
......@@ -594,8 +594,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']) : [];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment