[drupal-devel] [bug] Multiple node types are broken

jakeg drupal-devel at drupal.org
Sat Aug 27 08:53:16 UTC 2005

Issue status update for 
Post a follow up: 

 Project:      Drupal
 Version:      cvs
 Component:    node system
 Category:     bug reports
 Priority:     critical
 Assigned to:  chx
 Reported by:  chx
 Updated by:   jakeg
 Status:       patch (code needs review)


Except on third example surely their shouldn't be spaces in 'node type
c' as surely that won't work?

Just to make it clear to people: this patch enables a module, such as
project.module, to define more than one node type, using different
hooks for each of those node types within the same module. Otherwise,
functions would have to be shared between the node types defined by the
function, or a different module would be needed for each node type.
Neither of which are desirable.


Previous comments:

Sat, 27 Aug 2005 08:31:11 +0000 : chx

Attachment: http://drupal.org/files/issues/node_basename.patch (3.92 KB)

People come and tell me that I have broken node_get_module_name. I tell
them I fixed it. This leads nowhere. Yesterday Kjartan, jakeg and me
had finally a conversation during which we have arrived to the
conclusion that there is no need for two hooks and hook_node_name could
return either a string or an array in the form of:

array('type-a' => array('node type a', 'base')), 'type-b' => 'node type b', 'node type c');

Which would define a 'type-a' , with a human readable name 'node type
a' and base_load would be called for hook_load and so forth. for
'type-b' , the difference is that modulename_load would be called. For
'node type c', the node type would be modulename.

More information about the drupal-devel mailing list