Teaser displays with entire content as well

jadedsabre - June 12, 2007 - 19:59
Project:Book Review
Version:5.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

On nodes where only the teaser/excerpt should display, the entire content of the book review is also displaying. The teaser appears, immediately followed by the whole review.

I don't know why this is happening, and can't figure out how to turn off the display of the entire book review on nodes that should only be displaying the teaser.

#1

jadedsabre - June 16, 2007 - 03:32
Category:support request» bug report

After further digging, it appears to be a bug in bookreview_view method. In the 4.7 version of the code, there's an if($page) that was ignored in the upgrade to 5.x. The following code behaves as expected:

function bookreview_view(&$node, $teaser = FALSE, $page = FALSE) {
   global $theme;

   $node = node_prepare($node, $teaser);
   if($page) {
     $themefunction = "{$theme}_bookreview_content";
     if (!function_exists($themefunction)) {
       $themefunction = 'bookreview_content';
     }
    // $node = node_prepare($node, $teaser);

     $node->content['bookreview'] = array(
       '#value' => theme($themefunction, $node),
       '#weight' => 1,
     );
   }

   return $node;
}

I attempted to create a patch, but line endings had changed and produced an overly verbose patch.

 
 

Drupal is a registered trademark of Dries Buytaert.