diff --git a/includes/theme.inc b/includes/theme.inc index 4243f0d79ae32636782583f2cd6cad02501fea4f..52725b9df23d892b197beab9a1160802b9a03b75 100644 --- a/includes/theme.inc +++ b/includes/theme.inc @@ -776,6 +776,12 @@ function drupal_find_theme_functions($cache, $prefixes) { $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 +847,12 @@ function drupal_find_theme_templates($cache, $extension, $path) { '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);