3

Why do all of these menu items return "Access Denied" pages no matter how many times I drush cc all and clear cache from admin/config/performance?

/**
 * Implements hook_menu()
 */
function caplogin_menu() {
  $items = array();
  $items['join'] = array(
    'title' => 'Foo settings',
    'access arguments' => array('access content'),
    'type' => MENU_NORMAL_ITEM,
  );
  $items['join/signup'] = array(
    'page callback' => 'caplogin_unified_registration',
    'access arguments' => array('access content'),
    'title' => 'Request Member Online Credentials',
    'type' => MENU_DEFAULT_LOCAL_TASK,
  );
  $items['join/login'] = array(
    'page callback' => 'caplogin_unified_login',
    'access arguments' => array('access content'),
    'title' => 'Members Login',
    'type' => MENU_LOCAL_TASK,
  );
  return $items;
}
2
  • Access denied for everybody ? Or just normal users? You didn't mention if the user accessing has the Role access content BTW.
    – drcelus
    Mar 6, 2013 at 6:50
  • 1
    Have you given permissions for anonymous user, since you are using access arguments you need to set appropriate permissions else it will show access denied page.
    – GoodSp33d
    Mar 6, 2013 at 8:55

1 Answer 1

5

For the first menu item, you didn't provide any page callback, and MENU_DEFAULT_LOCAL_TASK menu items inherited it from the parent menu item. In this case, Drupal returns a 403 error.
For the last one, the reason can be one of the following:

  • The page callback function doesn't exist, or it is defined in a file that is not the module file
  • The user account doesn't have the permission 'access content'

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.