description not printed -- must call node_prepare()

dww - March 7, 2007 - 01:01
Project:Decisions
Version:5.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:dww
Status:closed
Description

once you implement hook_view(), node_prepare() (which handles filtering and putting $node->body or $node->teaser into $node->content) is not called automatically. so, to actually display the decision's "description" field in decision output, you need to call node_prepare() yourself. attached patch does this. i also set this field's weight in the content array to -1 so the description would come before all the voting-specific goo. that seemed like the most clear and intuitive placement, but feel free to rip out that line if you'd rather it shows up at the bottom of the page if you'd prefer.

AttachmentSize
decisions-body.patch.txt813 bytes

#1

dww - March 7, 2007 - 01:43
Status:needs review» fixed

i found anarcat in IRC, who reviewed and committed this (to both HEAD and DRUPAL-5). thanks!

#2

Anonymous - March 21, 2007 - 02:33
Status:fixed» closed
 
 

Drupal is a registered trademark of Dries Buytaert.