Closed (fixed)
Project:
Omega
Version:
6.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Issue tags:
Reporter:
Created:
29 Oct 2009 at 05:04 UTC
Updated:
3 Jan 2014 at 00:29 UTC
Jump to comment: Most recent
I just found an issue while subtheming related to the code from the Studio theme & the hook_preprocess implementation that calls files from the preprocess directory.
Tested in a dev sandbox, this code seems to now work properly.
/**
* Implementation of hook_preprocess()
*
* This function checks to see if a hook has a preprocess file associated with
* it, and if so, loads it.
*
* @param $vars
* @param $hook
* @return Array
*/
function canvas_preprocess(&$vars, $hook) {
// Collect all information for the active theme.
$themes_active = array();
global $theme_info;
// If there is a base theme, collect the names of all themes that may have
// preprocess files to load.
if($theme_info->base_theme) {
global $base_theme_info;
foreach($base_theme_info as $base){
$themes_active[] = $base->name;
}
}
// Add the active theme to the list of themes that may have preprocess files.
$themes_active[] = $theme_info->name;
// Check all active themes for preprocess files that will need to be loaded.
foreach($themes_active as $name) {
if(is_file(drupal_get_path('theme', $name) . '/preprocess/preprocess-' . str_replace('_', '-', $hook) . '.inc')) {
include(drupal_get_path('theme', $name) . '/preprocess/preprocess-' . str_replace('_', '-', $hook) . '.inc');
}
}
}
I will be testing this on my core development sandbox tomorrow, and patching if it works.
This was found causing issues in hook_preprocess node on a subtheme where it was only getting called once on pages with multiple nodes. The attributes being assigned by the default preprocess functionality in the Omega theme.
Solution was found here: http://cvs.drupal.org/viewvc.py/drupal/contributions/themes/studio/canvas/template.php?revision=1.3&view=markup
Comments
Comment #1
himerus commentedWill be fixed in alpha5