$page was removed from hook_node_view(), but the book module still does:

function book_node_view($node, $teaser, $page) {
  if (!$teaser) {
    if (!empty($node->book['bid']) && $node->build_mode == NODE_BUILD_NORMAL) {
      $node->content['book_navigation'] = array(
        '#markup' => theme('book_navigation', $node->book),
        '#weight' => 100,
      );

      if ($page) {
        menu_set_active_trail(book_build_active_trail($node->book));
        menu_set_active_menu_name($node->book['menu_name']);
      }
    }
  }

  book_node_view_link($node, $teaser, $page);
}

I basically means that the book breadcrumbs are currently broken. We haven't seen that because they are not tested.

Comments

damien tournoud’s picture

Status: Active » Needs review
StatusFileSize
new6.27 KB

The good news is that now that we have multi-menu trail computation (thanks to the administrative menu patch) we don't need to do that into the book module anymore.

This patch comes with a full test suite for book breadcrumbs, and some code style fixes for book.test.

chx’s picture

Status: Needs review » Needs work

Calling theme() from a parent Drupal and comparing it to a themed object in the child Drupal is not going to work.

chx’s picture

Also note: very nice patch.

damien tournoud’s picture

Status: Needs work » Needs review
StatusFileSize
new6.55 KB

Fixed the test. chx, you made me write XPath again... ;(

damien tournoud’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new6.55 KB
damien tournoud’s picture

Hum. I wasn't meaning to change the status.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Now that is a nice clean-up. Way to make use of APIs in the removal of old, crufty code.

Committed to HEAD with a small doc clarification above all of those checkBookNode() calls which are obtuse to parse without reading the function signature.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.