# This patch file was generated by NetBeans IDE # This patch can be applied using context Tools: Apply Diff Patch action on respective folder. # It uses platform neutral UTF-8 encoding. # Above lines and this line are ignored by the patching process. Index: modules/book/book.pages.inc --- modules/book/book.pages.inc Base (1.27) +++ modules/book/book.pages.inc Locally Modified (Based On 1.27) @@ -77,9 +77,11 @@ if (isset($node->book)) { $tree = book_menu_subtree_data($node->book); $contents = book_export_traverse($tree, 'book_node_export'); + return theme('book_export_html', array('title' => $node->title, 'contents' => $contents, 'depth' => $node->book['depth'])); } - - return theme('book_export_html', array('title' => $node->title, 'contents' => $contents, 'depth' => $node->book['depth'])); + else { + drupal_not_found(); + } } else { drupal_access_denied(); Index: modules/book/book.test --- modules/book/book.test Base (1.27) +++ modules/book/book.test Locally Modified (Based On 1.27) @@ -229,11 +229,15 @@ $this->assertText($node->title, t('Node title found in printer friendly version.')); $this->assertRaw(check_markup($node->body[LANGUAGE_NONE][0]['value'], $node->body[LANGUAGE_NONE][0]['format']), t('Node body found in printer friendly version.')); } - + // Make sure we can't export an unsupported format. $this->drupalGet('book/export/foobar/' . $this->book->nid); - $this->assertResponse('404', t('Unsupported export format returned "not found".')); - + $this->assertResponse('404', t('Unsupported export format returned "not found".')); + + // Make sure we get a 404 on a not existing book node. + $this->drupalGet('book/export/html/123'); + $this->assertResponse('404', t('Not existing book node returned "not found".')); + // Make sure an anonymous user cannot view printer-friendly version. $this->drupalLogout();