Hi all

I have created a small module and i wrote everything in my module file.
But i want to write more and it is becoming very untidy. So i put most of my code in a second file and included this file into the .info file like this

files[] = filename

But now it can not find the functions any more. I have deleted it all and reinstalled it but it still is not picking them up. ( error Call to undefined function )

Any suggestions.

Marcel

Comments

Nexsoft’s picture

You should use module_load_include() instead. Place the function in the hook_init() function and you should be god to go. Read a longer answer here http://drupal.stackexchange.com/questions/861/are-files-from-custom-modu...
/Johan

mklynx’s picture

Hi

You mean like this

/**
* Implementation of hook_init
*/
function module_init() {
module_load_include('inc', 'module','file');
}

Still getting the same error.
Marcel

mklynx’s picture

Hi found the problem

I was putting file.inc in there and i should have dropped the inc.

Marcel