diff -dur a/spam.module b/spam.module --- a/spam.module 2011-07-21 18:14:25.036890445 -0700 +++ b/spam.module 2011-07-21 19:33:09.406843018 -0700 @@ -577,7 +584,6 @@ function spam_mark_load($type, $id, $action) { if (is_numeric($id) && ($action == 'spam' || $action == 'not_spam')) { // We load these files here in case the menu function is called before _init. See https://drupal.org/node/1194730 - spam_load_inc_files(); if (spam_invoke_module($type, 'content_module') == $type) { if ($action == 'spam') { _spam_update_statistics(t('@type manually marked as spam', array('@type' => $type))); @@ -922,19 +928,33 @@ } /** - * As the spam module isn't a core Drupal module, those modules won't - * utilize its API. We define the appropriate hooks for these modules in the - * content/ subdirectory. For example, we define the spam api hooks for the - * node module in content/spam_content_node.inc. + * Since the spam module is not a core Drupal module, the core modules won't + * know of the spam module API. * - * Any other 3rd party module must define its own spam hooks if it wants to - * implement its own filters. + * Instead, we define the appropriate hooks for these modules in the + * spam/content/ sub-directory. For example, we define the spam api hooks for the + * node module in spam/content/spam_content_node.inc. + * + * Any other 3rd party module is expected to define its own spam hooks if it + * wants to implement its own filters. + * + * The include files MUST be loaded at the same time this .module file is loaded. + * This is important because they include hook functions that should be defined + * in the corresponding .module file (i.e. node.module.) + * + * Loading in the hook_boot() is too early (i.e. before common.inc is loaded?!) + * + * Loading in the hook_init() is too late since all the modules having a hook_init() + * function implemented and that run before the spam_init() hook is called would + * not see the special spam hooks. Especially, the hook_nodeapi(), hook_user(), and + * other similar hooks would be missing and not be run as expected. + * + * The only way to go like the system does is to load those .inc files at the same + * time we get loaded. * * @see spam_load_inc_files() */ -function spam_init() { - spam_load_inc_files(); -} +spam_load_inc_files(); /** * Load the inc files for the various content types.