- 🇺🇸United States lwalley
This still appears to be an issue in D7. It is only noticeable if there is a views-view.tpl.php template in the theme, and if the view in use does not have any exposed filters or similar that independently loads "views/theme/theme.inc".
The issue, as described in the original post, is that "views_content_plugin_display_ctools_context::render()" only includes the template path and file, it does not include the other includes. When overriding the template in the theme, the template path and file are to the theme template, not to "views/theme/theme.inc" so "template_preprocess_views_view()" is not available and never called:
// We want to process the view like we're theming it, but not actually // use the template part. Therefore we run through all the preprocess // functions which will populate the variables array. $hooks = theme_get_registry(); $info = $hooks[$this->definition['theme']]; if (!empty($info['file'])) { @include_once './' . $info['path'] . '/' . $info['file']; } $this->variables = array('view' => &$this->view); if (isset($info['preprocess functions']) && is_array($info['preprocess functions'])) { foreach ($info['preprocess functions'] as $preprocess_function) { if (function_exists($preprocess_function)) { $preprocess_function($this->variables, $this->definition['theme']); } } } }
In D7, also including everything in "$info['includes']", solves the issue e.g. something like:
+++ b/views_content/plugins/views/views_content_plugin_display_ctools_context.inc @@ -80,6 +80,11 @@ class views_content_plugin_display_ctools_context extends views_plugin_display { if (!empty($info['file'])) { @include_once './' . $info['path'] . '/' . $info['file']; } + if (!empty($info['includes'])) { + foreach ($info['includes'] as $include) { + @include_once './' . $include; + } + } $this->variables = array('view' => &$this->view); if (isset($info['preprocess functions']) && is_array($info['preprocess functions'])) {
Since this issue is closed, I won't add a patch, but just wanted to make a note in case anyone else is running into this.