diff options
author | Dries Buytaert <dries@buytaert.net> | 2009-06-12 08:39:40 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2009-06-12 08:39:40 +0000 |
commit | 3d64cb5ecae7c0d093e1343f87901769dc7d819e (patch) | |
tree | 765b3104ae2bbdf96ac677f8deab9b5457ffa4bf /modules/book | |
parent | bfdea95337376b00e60049b640c076e8ab32293f (diff) | |
download | brdo-3d64cb5ecae7c0d093e1343f87901769dc7d819e.tar.gz brdo-3d64cb5ecae7c0d093e1343f87901769dc7d819e.tar.bz2 |
- Patch #372743 by bjaspan, yched, KarenS, catch et al: node body and teasers as fields. Oh, my.
Diffstat (limited to 'modules/book')
-rw-r--r-- | modules/book/book.module | 4 | ||||
-rw-r--r-- | modules/book/book.test | 5 |
2 files changed, 4 insertions, 5 deletions
diff --git a/modules/book/book.module b/modules/book/book.module index e70b824a2..c17e45199 100644 --- a/modules/book/book.module +++ b/modules/book/book.module @@ -1037,7 +1037,7 @@ function book_export_traverse($tree, $visit_func) { function book_node_export($node, $children = '') { $node->build_mode = NODE_BUILD_PRINT; $node = node_build_content($node, FALSE, FALSE); - $node->body = drupal_render($node->content); + $node->rendered = drupal_render($node->content); return theme('book_node_export_html', $node, $children); } @@ -1054,7 +1054,7 @@ function book_node_export($node, $children = '') { function template_preprocess_book_node_export_html(&$variables) { $variables['depth'] = $variables['node']->book['depth']; $variables['title'] = check_plain($variables['node']->title); - $variables['content'] = $variables['node']->body; + $variables['content'] = $variables['node']->rendered; } /** diff --git a/modules/book/book.test b/modules/book/book.test index 8290f6f17..1c8ac0c32 100644 --- a/modules/book/book.test +++ b/modules/book/book.test @@ -141,8 +141,7 @@ class BookTestCase extends DrupalWebTestCase { // Check printer friendly version. $this->drupalGet('book/export/html/' . $node->nid); $this->assertText($node->title, t('Printer friendly title found.')); - $node->body = str_replace('<!--break-->', '', $node->body); - $this->assertRaw(check_markup($node->body, $node->format), t('Printer friendly body found.')); + $this->assertRaw(check_markup($node->body[0]['value'], $node->body[0]['format']), t('Printer friendly body found.')); $number++; } @@ -174,7 +173,7 @@ class BookTestCase extends DrupalWebTestCase { $edit = array(); $edit['title'] = $number . ' - SimpleTest test node ' . $this->randomName(10); - $edit['body'] = 'SimpleTest test body ' . $this->randomName(32) . ' ' . $this->randomName(32); + $edit['body[0][value]'] = 'SimpleTest test body ' . $this->randomName(32) . ' ' . $this->randomName(32); $edit['book[bid]'] = $book_nid; if ($parent !== NULL) { |