Index: includes/theme.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/theme.inc,v retrieving revision 1.415.2.13 diff -p -0 -r1.415.2.13 theme.inc *** includes/theme.inc 16 Oct 2008 13:50:59 -0000 1.415.2.13 --- includes/theme.inc 23 Oct 2008 19:36:15 -0000 *************** function _theme_process_registry(&$cache *** 264 **** --- 265 ---- + $result = array(); *************** function _theme_process_registry(&$cache *** 360 **** --- 362,381 ---- + + // Let themes have preprocess functions even if they didn't register a template. + if ($type == 'theme' || $type == 'base_theme') { + foreach ($cache as $hook => $info) { + // Check only if it's a template and not registered by the theme or engine + if (!empty($info['template']) && empty($result[$hook])) { + if (!isset($info['preprocess functions'])) { + $cache[$hook]['preprocess functions'] = array(); + } + if (function_exists($name . '_preprocess')) { + $cache[$hook]['preprocess functions'][] = $name . '_preprocess'; + } + if (function_exists($name . '_preprocess_' . $hook)) { + $cache[$hook]['preprocess functions'][] = $name . '_preprocess_' . $hook; + } + // Ensure uniqueness. + $cache[$hook]['preprocess functions'] = array_unique($cache[$hook]['preprocess functions']); + } + } + }