Put the access callback function in a separated file When I put the access callback function in a separated file I get an error.

$items['node/%node/join'] = array(
    'title' =&gt; t('Join Game'),
    'page callback' =&gt; 'agentweb_membership_join',
    'page arguments' =&gt; array(1),
    'access callback' =&gt; '_agentweb_membership_join_access',
    'access arguments' =&gt; array(1),
    'type' =&gt; MENU_LOCAL_TASK,
    'file' =&gt; 'join.page.inc',
);


When I put _agentweb_membership_join_access() in join.page.inc I get an error, but when I move it to agentweb_membership.module everything works correctly.

Why does it happen?
The access callback has to be in the same file; the file passed in the "file" property gets loaded only if the access callback returns TRUE. The only other "solution" is to use an include at the top of your module.