Using hook_form_alter in overlay admin theme I am using hook_form_alter in a custom module to remove some fields from the block edit screen to clean up the ui for users of a certain role

function module_form_block_admin_configure_alter(&amp;$form, &amp;$form_state, $form_id) {
  global $user;
  if (in_array('staff member', $user-&gt;roles)) {
    $form['visibility_title']['#access'] = FALSE;
    $form['visibility']['#access'] = FALSE;
    return $form;
  }
}


It works great. However, when the form appears in Drupal's admin overlay using the site's admin theme, Seven, the above code is not applied.

Is this because it's in an overlay? Or because it's a different theme? How can I get the hook_form_alter to apply globally?

FWIW, adding

function module_form_alter(&amp;$form, &amp;$form_state, $form_id) {
    dpm($form);
}


doesn't print anything above the form in the overlay. But when I switch the admin theme to the site's theme, it properly dpm's the form.

Note: The custom module and the site's custom theme have the same name. Is this the problem?
Thanks to Clive's tip I realized that because my module and theme had the same name, the hook was being applied at the theme level. I renamed my module and now it works!