### Eclipse Workspace Patch 1.0
#P Drupal Head
Index: modules/node/node.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.module,v
retrieving revision 1.1183
diff -u -r1.1183 node.module
--- modules/node/node.module	16 Dec 2009 19:53:53 -0000	1.1183
+++ modules/node/node.module	17 Dec 2009 02:56:49 -0000
@@ -1400,6 +1400,7 @@
   }
 
   // Clean up name so there are no underscores.
+  $variables['template_files'][] = 'node';
   $variables['template_files'][] = 'node-' . str_replace('_', '-', $node->type);
   $variables['template_files'][] = 'node-' . $node->nid;
 }
Index: includes/theme.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/theme.inc,v
retrieving revision 1.557
diff -u -r1.557 theme.inc
--- includes/theme.inc	2 Dec 2009 14:56:32 -0000	1.557
+++ includes/theme.inc	17 Dec 2009 02:56:48 -0000
@@ -891,7 +891,14 @@
       $suggestions[] = $variables['template_file'];
     }
     if ($suggestions) {
-      $template_file = drupal_discover_template($info['theme paths'], $suggestions, $extension);
+      $suggestions = array_reverse($suggestions);
+      foreach ($suggestions as $suggestion) {
+      	if (isset($hooks['files'][$suggestion])) {
+      	  $template_file = $hooks['files'][$suggestion];
+      	  break;
+      	}
+      }
     }
     if (empty($template_file)) {
       $template_file = $info['template'] . $extension;
@@ -1035,6 +1041,7 @@
  */
 function drupal_find_theme_templates($cache, $extension, $path) {
   $templates = array();
+  $templates['files'] = $cache['files'];
 
   // Collect paths to all sub-themes grouped by base themes. These will be
   // used for filtering. This allows base themes to have sub-themes in its
@@ -1080,6 +1087,8 @@
         'path' => dirname($file->uri),
       );
     }
+    // Store location of each template.
+    $templates['files'][$template] = dirname($file->uri).'/'.$template.$extension;
     // 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.
