[documentation] [bug] Node_example.module (4.7) doesn't use a correct _view() order

fax8 drupal-docs at drupal.org
Mon Dec 12 17:34:56 UTC 2005


Issue status update for 
http://drupal.org/node/40891
Post a follow up: 
http://drupal.org/project/comments/add/40891

 Project:      Documentation
 Version:      <none>
 Component:    Developer Guide
 Category:     bug reports
 Priority:     critical
 Assigned to:  Anonymous
 Reported by:  fax8
 Updated by:   fax8
 Status:       active

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

<?php
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:

<?php
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




fax8



More information about the documentation mailing list