0

When I try to enable a module I get

Fatal error: Call to undefined function modulename_cron() in /home/modulename.install on line 17 

In modulename.install I have

function modulename_install() {
  db_query('ALTER TABLE {node_revisions} ENGINE = MYISAM');
  db_query('ALTER TABLE {node_revisions} ADD FULLTEXT `similar` (`title`, `body`)');
  modulename_cron();
}

module_cron() is definitely defined in my modulename.module file. What could cause this problem and how could I fix it?

1 Answer 1

1

Have a look at the documentation for hook_install. It says:

Note that functions declared in the module being installed are not yet available. The implementation of hook_install() will need to explicitly load the module before any declared functions may be invoked.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.