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.

CommentFileSizeAuthor
#2 node types.patch621 bytesSteven
node_30.patch509 bytesjonbob

Comments

TDobes’s picture

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

Steven’s picture

StatusFileSize
new621 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.

dries’s picture

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

Steven’s picture

Indeed Dries, I just committed it to 4-6.

Anonymous’s picture

Tommy Sundstrom’s picture

Version: » 4.6.0
Status: Closed (fixed) » Active

This problem seams to be back.

The node_example.module (from http://drupaldocs.org/api/head/file/contributions/docs/developer/example... ) works properly in Drupal 4.6 (ie will allow me to create new nodes) but not in the CVS version (8 sept 2005).

dopry’s picture

Status: Active » Closed (fixed)

Issue was closed in 4.6. Do not reopen against 4.6 when the bug reoccurs in CVS.
I'm fairly certain this is fixed in CVS.