diff --git a/includes/theme.inc b/includes/theme.inc
index e554df2963b1d3c0e7a31320bbec1478574669a5..0bea6fa9a92c533db745bd9d336fad1866d71774 100644
--- a/includes/theme.inc
+++ b/includes/theme.inc
@@ -472,6 +472,7 @@ function _theme_process_registry(&$cache, $name, $type, $theme, $path) {
           }
           if (function_exists($name . '_' . $phase . '_' . $hook)) {
             $cache[$hook][$phase_key][] = $name . '_' . $phase . '_' . $hook;
+            $cache[$hook]['theme path'] = $path;
           }
           // Ensure uniqueness.
           $cache[$hook][$phase_key] = array_unique($cache[$hook][$phase_key]);