Attached is a patch that makes InsertNode apply the normal Drupal processing to the body of the node, so that things like CCK fields and filter tags will be included/processed. Note: this may/will break pages where a node inserts it's own body. It should be pretty easy to prevent this, but I think anyone inserting the same node in itself deserves to have broken pages. ;) Well, not really, but I don't have time to fiddle around with it.

Comments

OliverColeman’s picture

Actually, this may/will break all pages that are part of a cycle of node insertions (eg, let A, B and C be nodes. If A inserts B, B inserts C, and C inserts A, then A, B and C will break).

AlexisWilke’s picture

Oliver,

Indeed, loops will break. Note that in the following, the last test on the 2nd line will always fail (i.e. return false).

+  if ($matches[2] == 'body' || $matches[2] == 'collapsed')
+    $node = node_build_content($node, $matches[2] == 'teaser');

I'm testing so see whether that fix would work in 6.x... 8-)

Thank you.
Alexis

OliverColeman’s picture

You're right, the last test on the second line will always fail; it was a vestige of previous development, like that crazy appendix in humans... :)

AlexisWilke’s picture

Oliver,

Okay! I have found the proper function to use in Drupal 6.x. It is called node_view().

node_view($node, $teaser = FALSE, $page = FALSE, $links = TRUE);

That can be used to display the body, the teaser and the links.

I'm about to include that in the D6 version (btw, I do not support the v5.x so I will not be applying your patches, however, feel free to contact the primary author to be included as a programmer if you want to do so! It would be great, there are several other issues in v5.x that need to be fixed... 8-) )

EDIT:
This is now checked in the -dev version. It works great for me and includes an anti-recursivity feature too.

Thank you.
Alexis

AlexisWilke’s picture

This issue is now 2 years old, closing. You should at least be on D6.

Thank you.
Alexis