[development] The future of hook_node_info()

Derek Wright drupal at dwwright.net
Thu May 21 15:43:23 UTC 2009

On May 21, 2009, at 7:07 AM, Nathaniel Catchpole wrote:

> It'd also be worth grepping Drupal 6 contrib to see which modules  
> are using it and how.

A few node types you're all *very* familiar with, which are handled  
via hook_node_info():


That can't change until everything about each of these node types is  
handled by pure fields:

"convert project* to CCK"

That's going to be a very huge task, and will require quite an upgrade  
path.  It could be started in a 6.x-2.* branch to get us closer to  
core fields in time for the D7 port, or we could just do the whole  
conversion during the D7 port itself.  I guess it depends on how  
different D6 CCK API is from D7 field API.

And yeah, all the stuff Larry said is true, too. ;)

Off the top of my head, the only reasons project* uses  
hook_node_info() are:

A) It's almost as old as Drupal itself, completely predates CCK, etc,  
and no one's ever provided resources to convert it to CCK before.

B) hook_access(), and the lack of something like an 'access' operation  
in hook_nodeapi() (there are at least two big issues in core about,  
(one now dupe with the other) both of which have stalled):


C) The hassle of programatically defining CCK content types and fields.

-Derek (dww)

More information about the development mailing list