Migrating custom node type modules

Today I finally started porting the modules I had written for zerokspot.com from Drupal 4.7 to 5.0. So far everything has worked out just fine apart from one little thing:

I added the modulename.info file to my book review module and there it was in the admin panel. Everything’s great. Then I wanted to create a new node with this type and noticed (1) that it doesn’t appear in the main listing but only in the navigation sidebar and (2) that when I try to submit the new node, I get an error similar to this one:

array_merge_recursive() [<a href='function.array-merge-recursive'>function.array-merge-recursive</a>]: Argument #2 is not an array in /opt/wwwdev/htdocs/drupal-5.0/modules/node/node.module on line 1916.

So I checked my modules hook_form implementation, but couldn’t really find where the $form array should not be an array ;-)

Then finally I got the idea to search the forums on drupal.org for a solution and found this one. I would never have searched in the hook_node_info implementation. Thanks yodadex :)

The next time I should really try to apply all the changes mentioned in the module conversion guide before getting desperate ;)