Missing argument in hook_theme and Ilegal offset I have built hook_themes many times and never encountered this before but I am getting the following errors:

Warning: Missing argument 1 for geocoder_custom_theme
Warning: Missing argument 2 for geocoder_custom_theme
Warning: Missing argument 3 for geocoder_custom_theme
Warning: Missing argument 4 for geocoder_custom_theme
Warning: Illegal offset type in isset or empty in drupal_theme_access() line 53

I have tried clearing cache, renaming the hook, registry rebuild and nothing works.  I have another hook_theme in a different custom module that is basically the same thing but works completely fine.  Also if i simply return an empty array() it still does it.  Its like drupal doesn't send any values to my hook for whatever reason.

Code:

function geocoder_custom_theme($existing, $type, $theme, $path)
{
  return array(
    'geocoder_custom_before_me' =&gt; array(
      'variables' =&gt; array('string' =&gt; array()),
      'template' =&gt; 'geocoder-before',
      'path' =&gt; drupal_get_path('module', 'geocoder_custom') . '/theme'
    ),
    'geocoder_custom_after_me' =&gt; array(
      'variables' =&gt; array('string' =&gt; array()),
      'template' =&gt; 'geocoder-after',
      'path' =&gt; drupal_get_path('module', 'geocoder_custom') . '/theme'
    )
  );
}
That function is taken from Drupal as an implementation of hook_custom_theme(), not hook_theme(). Since the former doesn't get any arguments, PHP is complaining about the function declaring arguments for which it doesn't get any value.

The fix is changing the short name of the module from geocoder_custom to geocoder, for example.