Closed (fixed)
Project:
Documentation
Component:
Developer Guide
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
12 Dec 2005 at 17:34 UTC
Updated:
26 Dec 2005 at 21:00 UTC
The current implementation of hook_view in node_example.module
doesn't use a correct order of instruction.
Doing node_prepare as last instruction will strip out every html tags
added by theme_node_example_order_info()
Simply change this
function node_example_view(&$node, $teaser = FALSE, $page = FALSE) {
$order_info = theme('node_example_order_info', $node);
$node->body .= $order_info;
$node->teaser .= $order_info;
$node = node_prepare($node, $teaser);
}
into:
function node_example_view(&$node, $teaser = FALSE, $page = FALSE) {
$node = node_prepare($node, $teaser);
$order_info = theme('node_example_order_info', $node);
$node->body .= $order_info;
$node->teaser .= $order_info;
}
should fix this.
Fabio
Comments
Comment #1
drewish commentedI think you're correct that te example is wrong but after looking at the code in node_view(), it looks like node_prepare() is only called if you don't implement a hook_view():
Comment #2
drewish commentedSorry, submitted too soon. What I meant to say was, I searched through the core modules and the only time it really seemd like it was being used was when a hook_view had been implemented to adjust the breadcrumb trail.
After a little more reflection, I think your change is probably the right one.
Comment #3
drewish commentedCommited to CVS.
Comment #4
(not verified) commented