I am trying to make it work, but it seems simply not working in Drupal 6. Maybe this is the issue, it does not work on D6?

This is the code:

// $file_path = module_load_include('inc', 'MYMODULE.inc', 'includes/MYMODULE.inc');
$file_path = module_load_include('MYMODULE', 'MYMODULE.inc');

// Testing.
if ($file_path === FALSE) {
  dpm('Failed to include: ' . $filename);
}
else {
  dpm('Successfully included: ' . $file_path);
}

I have tried also adding a drupal_load before and some other things, like changing params, moving the inc file to the root module folder and so, but I allways get the same:

Failed to include: sites/all/modules/MYCOMPANY/MYMODULE/MYMODULE.module

any idea of what am I doing wrong?

Thanks a log.

Comments

Did you look at

Did you look at http://api.drupal.org/api/drupal/includes%21module.inc/function/module_l...?

You simply want

module_load_include('inc', 'your_module_name', 'includes/your_module_name');

Not the third parameter should not include the extension (in this case .inc).

I am very happy now, that was

I am very happy now, that was the issue, thank you thank you thank you very much :-).

Have a lovely weekend :-D

nobody click here