diff --git a/starterkits/wxt/THEMENAME.theme b/starterkits/wxt/THEMENAME.theme index e93b22f..64b4071 100644 --- a/starterkits/wxt/THEMENAME.theme +++ b/starterkits/wxt/THEMENAME.theme @@ -43,12 +43,13 @@ function THEMENAME_theme_suggestions_page_alter(array &$suggestions, array $vari $node = \Drupal::routeMatch()->getParameter('node'); if ($node instanceof NodeInterface) { - if (!empty($node->book) && $node->book['bid'] != 0) { + $book_array = $node->getBook(); + if (!empty($book_array) && $book_array['bid'] != 0) { /** @var \Drupal\wxt_library\LibraryService $wxt */ $wxt = \Drupal::service('wxt_library.service_wxt'); $wxt_active = $wxt->getLibraryName(); - if ($node->book['bid'] == $node->id()) { + if ($book_array['bid'] == $node->id()) { // Theme book index page. $suggestions[] = $variables['theme_hook_original'] . '__book_index'; $suggestions[] = $variables['theme_hook_original'] . '__' . $wxt_active . '__book_index'; diff --git a/wxt_bootstrap.theme b/wxt_bootstrap.theme index 8cee43f..7a4239a 100644 --- a/wxt_bootstrap.theme +++ b/wxt_bootstrap.theme @@ -67,12 +67,13 @@ function wxt_bootstrap_theme_suggestions_page_alter(array &$suggestions, array $ $node = \Drupal::routeMatch()->getParameter('node'); if ($node instanceof NodeInterface) { - if (!empty($node->book) && $node->book['bid'] != 0) { + $book_array = $node->getBook(); + if (!empty($book_array) && $book_array['bid'] != 0) { /** @var \Drupal\wxt_library\LibraryService $wxt */ $wxt = \Drupal::service('wxt_library.service_wxt'); $wxt_active = $wxt->getLibraryName(); - if ($node->book['bid'] == $node->id()) { + if ($book_array['bid'] == $node->id()) { // Theme book index page. $suggestions[] = $variables['theme_hook_original'] . '__book_index'; $suggestions[] = $variables['theme_hook_original'] . '__' . $wxt_active . '__book_index';