Ctools plugin views_content_plugin_display_ctools_context: "Context" views are empty if Drupal theme registry is cached

Created on 1 February 2013, almost 12 years ago
Updated 15 July 2024, 5 months ago

Hello. In my project I use Drupal 6, last dev version of Ctools 6.x-1.x-dev (2012-Nov-30), Views 6.x-3.0 and Panels 6.x-3.10 modules.

I have several "Context" views placed in panel and I'd caught next problem: if I clear Drupal cache and then open page with my context view this view shows data correctly. But when I reload page my view became empty. I found that in case when view is empty method render() in plugin views_content_plugin_display_ctools_context doesn't call function template_preprocess_views_view(). This function have to be called from this code:


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']);
    }
  }
}

Array $info['preprocess functions'] contains value template_preprocess_views_view, but function template_preprocess_views_view() doesn't exists on this step. This function declared in Views module in theme/theme.inc file and this file is included only when Drupal theme registry is empty (functions _theme_build_registry() and _theme_process_registry()).

I've made a small patch to solve this problem (in attach) and have a questions: is this a Drupal bug? Why Drupal not include theme/theme.inc if theme registry cached? Or this is a Ctools problem? Or this is a problem only in my Drupal installation?

πŸ› Bug report
Status

Closed: outdated

Version

1.0

Component

Views Content

Created by

πŸ‡·πŸ‡ΊRussia Romka

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024