I am trying my first module on Drupal 7 on the behalf of experience on Drupal 6.

function custom_work_menu(){
  $items = array();

    'page callback' => 'drupal_get_form',
    'page arguments' => array('custom_work_mypage_view'),
    'access arguments' => array('access content'),

  return $items;

Upon accessing my page, I get access denied. What am I missing here?

1 Answer 1



Your code looks right

3 Things could be the problem

  1. 'mypage' could be a banned link.
  2. you don't have access to 'custom_work_mypage_view' form.
  3. Clear your cache. Without the 'access argument' line you will get access denied. If you added it then save your file, you will still get access denied until you clear your cache.

My gut feeling is #3.

  • 1
    access callback can not take place here, access callback is defined in string unlike access arguments as array. Jul 20, 2011 at 17:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.