[development] node_feed vs. node_build_content vs. nodeapi alter op

Gabor Hojtsy gabor at hojtsy.hu
Fri Jan 19 20:09:42 UTC 2007


Hi,

I in migrating weblabor.hu from Drupal 4.6 to 5.0 and found two
interesting issues in node building for rss and website view.

When the website view is generated in node_view(), then 
node_build_content() prepares the formapi-like array structure, which 
calls the view nodeapi hook. There is *very similar* code in node_feed(), 
only except that it does not remove the <!--break--> delimiter for some 
reason. This might be some leftover cruft, and node_build_content() should 
be reused there. I would submit a patch if verified.

More interesting is the usage of the 'alter' nodeapi hook. It is called 
when a node is disaplyed on the web (from node_view()), but is not called 
from node_feed(), when a node is displayed in a feed.

Now I can use this differenece to alter my nodes differently in web mode 
and rss mode (ie. I would like to have my upload related filters activate 
on the web, but only remove the special tags when I generate RSS). But 
seemingly this difference is a bug. Isn't the 'alter' nodeapi hook 
supposed to be used both in web mode and rss mode?

Gabor



More information about the development mailing list