[drupal-devel] [bug] "Create content" menu displays extraneous links

Dries drupal-devel at drupal.org
Thu May 26 19:30:31 UTC 2005


Issue status update for http://drupal.org/node/18275

 Project:      Drupal
 Version:      cvs
 Component:    node.module
 Category:     bug reports
 Priority:     normal
 Assigned to:  Anonymous
 Reported by:  JonBob
 Updated by:   Dries
 Status:       patch

Committed to HEAD.  Does this need to be backported to DRUPAL-4-6?  I'd
think so.




Dries



Previous comments:
------------------------------------------------------------------------

March 2, 2005 - 23:36 : JonBob

Attachment: http://drupal.org/files/issues/node_30.patch (509 bytes)

In the case where a node module defines no node types, like Flexinode or
CCK when no types have yet been defined, the node/add menu displays
links that do not work. One-line fix attached.




------------------------------------------------------------------------

March 29, 2005 - 12:26 : TDobes

+1... I've encountered this bug using flexinode.




------------------------------------------------------------------------

May 25, 2005 - 09:04 : Steven

Attachment: http://drupal.org/files/issues/node types.patch (621 bytes)

I don't think your patch is correct. If you use it, the simple modules
(blog, story, page) no longer have a link on the node add page.


There are two possibilities:


- Module implements hook_node_name(). The node type is the module name.
- Module implements hook_node_name() and hook_node_types(). The node
types are returned from the latter as an array.


If hook_node_types() returns an empty array (like flexinode), the if
clause evaluates to false, and a simple module-named node type is
assumed instead.


IMO the fix is the change the if() to is_array(). Patch attached.







More information about the drupal-devel mailing list