Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
6 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!1012Issue #3226887: Hreflang on non-canonical content pages,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10,!596Issue #3046532: deleting an entity reference field, used in a contextual view, makes the whole site unrecoverable,!496Issue #2463967: Use .user.ini file for PHP settings,!144Issue #2666286: Clean up menu_ui to conform to Drupal coding standards
...@@ -587,8 +587,7 @@ protected function buildItems(array $tree) { ...@@ -587,8 +587,7 @@ protected function buildItems(array $tree) {
// Allow book-specific theme overrides. // Allow book-specific theme overrides.
$element['attributes'] = new Attribute(); $element['attributes'] = new Attribute();
$element['title'] = $data['link']['title']; $element['title'] = $data['link']['title'];
$node = $this->entityTypeManager->getStorage('node')->load($data['link']['nid']); $element['url'] = 'entity:node/' . $data['link']['nid'];
$element['url'] = $node->toUrl();
$element['localized_options'] = !empty($data['link']['localized_options']) ? $data['link']['localized_options'] : []; $element['localized_options'] = !empty($data['link']['localized_options']) ? $data['link']['localized_options'] : [];
$element['localized_options']['set_active_class'] = TRUE; $element['localized_options']['set_active_class'] = TRUE;
$element['below'] = $data['below'] ? $this->buildItems($data['below']) : []; $element['below'] = $data['below'] ? $this->buildItems($data['below']) : [];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment