Need to override block.tpl.php in a module I need to define a block--custom.tpl.php file in a custom module and have that override the theme block.tpl.php.

Here is where I have ended up and it's not working.

Tell Drupal to look in my module:

function MODULE_theme_registry_alter(&amp;$theme_registry) {
  $theme_registry['block']['theme paths'][] = drupal_get_path('module', 'MODULE');
  $theme_registry['block']['theme paths'][] = drupal_get_path('module', 'MODULE') . '/theme';
}


In hook_preprocess_HOOK() suggest a new theme file:

function MODULE_preprocess_block(&amp;$variables) {
  $block = $variables['block'];

  if ($block-&gt;CONDITION) {
    $variables['theme_hook_suggestions'][] = 'block__MODULE';
  }
}


Now, I've created the file in the module's theme/ folder and called it block--MODULE.tpl.php.

I've turned on theme debugging in the settings file by un-commenting out $conf['theme_debug'] = TRUE;

Caches have been cleared multiple times. When I load the page I see in the debug comments:

&lt;!-- THEME DEBUG --&gt;
&lt;!-- CALL: theme('block') --&gt;
&lt;!-- FILE NAME SUGGESTIONS:
   * block--MODULE.tpl.php
   * block--block--6.tpl.php
   * block--block.tpl.php
   * block--content.tpl.php
   x block.tpl.php
--&gt;
&lt;!-- BEGIN OUTPUT from 'sites/all/themes/THEME/templates/block.tpl.php' --&gt;


And as you can see from the debug it is using the theme template file.

How do I get Drupal to select the proper theme file?
The following worked for me:

/**
 * Implements hook_theme().
 */
function rals_theme($existing, $type, $theme, $path) {
  $theme = array();
  $theme['block__custom'] = array(
    'render element' =&gt; 'content',
    'template' =&gt; 'block--custom',
    'path' =&gt; drupal_get_path('module', 'rals'),
   );
  return $theme;
}


/**
 * Implements hook_preprocess_HOOK().
 */
function rals_preprocess_block(&amp;$variables) {
  $block = $variables['block'];
  if ($block-&gt;bid == 3) {
    $variables['theme_hook_suggestions'][] = 'block__custom';
  }
}


and succesfully uses my module-folder-located template file for rendering the block with bid == 3.

Good luck in any case!