Hi all,
sorry for the unprecise bug report.
I have a panel which uses a views_content_plugin_display_ctools_context to display a selection of rows from a view.
While I kept clearing my registry cache at every page load everything worked fine. As soon I disabled it I got blank panes.
After some investigation I found out the culprit was inside views_content_plugin_display_ctools_context->render().
There is some code which mimics the view theming process without actually using the template part. It specifically include_onces the $info['file'] from theme registry, but doesn't take care of $info['include files'].
In my case the views/theme.inc wasn't being included thus making template_preprocess_views_view() unavailable and resulting in a blank pane.
I am sorry I can't be able to provide further steps to reproduce the bug. I am using a Zen sub theme.
I am attaching a couple of patches which use 2 slightly different approaches:
1. include all files in $info['include files'] unconditionally
2. include all files in $info['include files'] if the theme function is not defined.

Comments

Ashlar’s picture

Status: Active » Closed (won't fix)

This bug report has not been active for over six months. In an effort to clean-up the issue queue this item has been closed. If your modules are current and the report is still relevant please feel free to change the Status back to active.

lwalley’s picture

Issue summary: View changes

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.