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.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | node types.patch | 621 bytes | Steven |
| node_30.patch | 509 bytes | jonbob |
Comments
Comment #1
TDobes commented+1... I've encountered this bug using flexinode.
Comment #2
Steven commentedI 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.
Comment #3
dries commentedCommitted to HEAD. Does this need to be backported to DRUPAL-4-6? I'd think so.
Comment #4
Steven commentedIndeed Dries, I just committed it to 4-6.
Comment #5
(not verified) commentedComment #6
Tommy Sundstrom commentedThis 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).
Comment #7
dopry commentedIssue 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.