node_example.module for Drupal 6 has a node type with the same name as the module, and that makes it really difficult to distinguish when using the module name or the node name. I was struggling with my code for about five days before I went on to follow drupal's code and realized that I was using my_module_name_form(&$form) instead of my_node_name_form(&$form)...

For better understanding, I think it would be ideal to have two node types in the same module. That would clear all the edges.

Comments

bdragon’s picture

Component: Developer Guide » Documentation in CVS

Agreed..

betz’s picture

Project: Documentation » Drupal core
Version: » 7.x-dev
Component: Documentation in CVS » documentation

Changed the component to reflect the new component categorization. See http://drupal.org/node/301443

betz’s picture

Version: 7.x-dev » 6.x-dev

Changed the component to reflect the new component categorization. See http://drupal.org/node/301443

jhodgdon’s picture

Project: Drupal core » Examples for Developers
Version: 6.x-dev » 6.x-1.x-dev
Component: documentation » Node Example

This is an old issue report, probably fixed by now? We're managing the example modules in a different project anyway...

rfay’s picture

This remains true, but it would be appreciated if you could look at the existing node_example in the Examples module.Patches are welcome.

rfay’s picture

Title: Drupal 6 node_example.module » Drupal 6 node_example.module uses node name the same as module name
rfay’s picture

rfay’s picture

Title: Drupal 6 node_example.module uses node name the same as module name » Drupal 6 node_example.module uses node type the same as module name
googletorp’s picture

StatusFileSize
new1.36 KB

I took a look at this, and unless I'm missing something this should be a really easy fix.

Anyways I created a patch, so let me know, if this is good.

googletorp’s picture

Status: Active » Needs review

Forgot to set status.

rfay’s picture

Thanks for the good work. I'll be back and review in a week or so.

rfay’s picture

StatusFileSize
new3.22 KB

Worked a bit more on this, including adding some things that have been lacking in that example.

It still needs tests. I'd love to sneak tests in on this round. I'll probably do it next week if I can. @googletorp, would love it if you beat me to it.

I also haven't tested this code, but wanted to make sure and get it into the queue before losing it, as I"m traveling and using borrowed computer.

rfay’s picture

This has a simple test, but think it might accomplish the objective.

rfay’s picture

Status: Needs review » Fixed

Committed: http://drupal.org/cvs?commit=415896

Thanks for all the help, @googletorp - looking forward to your help on other issues.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.