First of all, what is the limitation of the status quo? "Filtered Text" option is not good enough for many filters which rely on 'view' nodeapi for various reasons. Here is some background: http://drupal.org/node/74314

Since there are so many filters with nodeapi-driven implementation, CCK needs a workaround to exercise their functionality. Here is a partial list of filter modules that need this fix:

  • insert_view.module
  • insert_block.module
  • inline.module
  • upload.module
  • freelinking.module

I think the problem could be solved via creating a new text processing option (call it "Node emulation") where formatter would:

1) Place the text value into teaser or body (to be configurable) of the node passed as argument
2) Invoke 'view' hook_nodeapi on this "dummy" node
3) Return resulting $node->body or $node->teaser

Does anyone have thoughts about this solution?

Comments

karens’s picture

If modules using nodeapi are not able to alter CCK nodes then I agree this is an issue to look into but am not sure yet about the best approach. I don't have time to dig into this right now, but am certainly interested in seeing some discussion about if and how this should be addressed.

karens’s picture

I'm also not sure I consider this a 'critical bug' or a 'critical feature', but I'll leave it marked as is for now :-)

eaton’s picture

As a side note, this is fixed in Drupal 5 -- modules that do the funky things like Insert View implement nodeapi's 'alter' op instead of 'view', and as such work perfectly with CCK.

dkruglyak’s picture

Unfortunately not everyone can move everything to 5.0 immediately. Just as I am not sure we can count on every filter using proper nodeapi implementation...

I think a "nodeapi emulator" widget could be a valuable safety valve for many possible problems that arise when you try to store a "node body template" as CCK text...

For example I am using CCK to store an HTML email template. This brings another very annoying problem: the

tag shows "as is" in CCK...

There needs to be an explicit way to treat a CCK field as a body of a regular node...

dkruglyak’s picture

Unfortunately not everyone can move everything to 5.0 immediately. Just as I am not sure we can count on every filter using proper nodeapi implementation...

I think a "nodeapi emulator" widget could be a valuable safety valve for many possible problems that arise when you try to store a "node body template" as CCK text...

For example I am using CCK to store an HTML email template. This brings another very annoying problem: the < ! -- break -- > tag shows "as is" in CCK...

There needs to be an explicit way to treat a CCK field as a body of a regular node...

discursives’s picture

This is a pretty interesting issue. For some reason I had not noticed this until now.

What I was wondering is why it works when it isn't themed, though. When I delete my tpl.php file I can see the inserted view, but not when i have my tpl.php file running in my theme.

erikhopp’s picture

Perhaps this is related? http://drupal.org/node/170921#comment-309074

Erik.

dkruglyak’s picture

Status: Active » Closed (fixed)

The issue is obsolete for 4.7.x. Eaton's solution addresses D5+.