Index: includes/theme.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/theme.inc,v
retrieving revision 1.452
diff -u -p -r1.452 theme.inc
--- includes/theme.inc	22 Nov 2008 13:55:27 -0000	1.452
+++ includes/theme.inc	23 Nov 2008 05:16:00 -0000
@@ -768,6 +768,7 @@ function drupal_find_theme_functions($ca
             $templates[$new_hook] = array(
               'function' => $match,
               'arguments' => $info['arguments'],
+              'pattern' => $info['pattern'],
             );
           }
         }
@@ -776,6 +777,12 @@ function drupal_find_theme_functions($ca
         $templates[$hook] = array(
           'function' => $prefix . '_' . $hook,
         );
+        // Ensure that the pattern is maintained from base themes to its sub-themes.
+        // Each sub-theme will have their functions scanned so the pattern must be
+        // held for subsequent runs.
+        if (isset($info['pattern'])) {
+          $templates[$hook]['pattern'] = $info['pattern'];
+        }
       }
     }
   }
@@ -841,6 +848,12 @@ function drupal_find_theme_templates($ca
         'path' => dirname($file->filename),
       );
     }
+    // Ensure that the pattern is maintained from base themes to its sub-themes.
+    // Each sub-theme will have their templates scanned so the pattern must be
+    // held for subsequent runs.
+    if (isset($cache[$hook]['pattern'])) {
+      $templates[$hook]['pattern'] = $cache[$hook]['pattern'];
+    }
   }
 
   $patterns = array_keys($files);
