It's not necessary to define 'file path' when the file to load is inside the module directory; it's enough to prefix with 'includes/' all the strings given for the 'file' array item.

Comments

avpaderno’s picture

This is a menu callback defined by another module, which works. As you see, it doesn't use 'file path', and it doesn't call drupal_get_path().

  $items['views/ajax'] = array(
    'title' => 'Views',
    'page callback' => 'views_ajax',
    'access callback' => 'user_access',
    'access arguments' => array('access content'),
    'description' => 'Ajax callback for view loading.',
    'file' => 'includes/ajax.inc',
    'type' => MENU_CALLBACK,
  );

The file is inside the module directory, and the file name includes the relative path from that directory.

'file path' is thought to be used when the file is taken from a directory that is not inside the directory of the module defining the menu callback.

Zohar.Babin’s picture

Status: Active » Fixed

fixed in 6.x-1.4

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.