Views / Panels / Panelizer / Ctools latest -dev's, this shouldn't be affected by panelizer though.

I have a view with a context pane, which I am using to display the view in a panel page. The first time the page is viewed after clearning the cache the view is displayed correctly. After the first page view I only get non-views panes (or nothing if there are none).

I have attempted to trace this for the view header and it looks like views_content_context_get_output() attaches the view object as $context->output, which then gets returned to views_content_views_header_content_type_render(). At this point it tries to assign $output['header'] to $block->content, but that array element doesn't exist - header is at $output['view']->header, and its neither markup or a renderable array (as far as i can tell).

Strangely, if I add an exposed filter or sort to the view, everything renders correctly. I've managed to replicate the issue using bartik instead of a custom theme, so that rules out a lot of errors.

Here's a backtrace if it helps.

|  1 0  views_content_views_header_content_type_render() /home/sam/www/gateway/docroot/sites/all/modules/contrib/ctools/views_content/plugins/content_types/views_header.inc:32
|  2 1  ctools_content_render() /home/sam/www/gateway/docroot/sites/all/modules/contrib/ctools/includes/content.inc:280
|  3 2  panels_renderer_standard->render_pane_content() /home/sam/www/gateway/docroot/sites/all/modules/contrib/panels/plugins/display_renderers/panels_renderer_standard.class.php:553
|  4 3  panels_renderer_standard->render_pane() /home/sam/www/gateway/docroot/sites/all/modules/contrib/panels/plugins/display_renderers/panels_renderer_standard.class.php:484
|  5 4  panels_renderer_standard->render_panes() /home/sam/www/gateway/docroot/sites/all/modules/contrib/panels/plugins/display_renderers/panels_renderer_standard.class.php:465
|  6 5  panels_renderer_standard->render_layout() /home/sam/www/gateway/docroot/sites/all/modules/contrib/panels/plugins/display_renderers/panels_renderer_standard.class.php:390
|  7 6  panels_renderer_standard->render() /home/sam/www/gateway/docroot/sites/all/modules/contrib/panels/plugins/display_renderers/panels_renderer_standard.class.php:358
|  8 7  panels_display->render() /home/sam/www/gateway/docroot/sites/all/modules/contrib/panels/panels.module:752
|  9 8  panels_render_display() /home/sam/www/gateway/docroot/sites/all/modules/contrib/panels/panels.module:1084
| 10 9  panels_panel_context_render() /home/sam/www/gateway/docroot/sites/all/modules/contrib/panels/plugins/task_handlers/panel_context.inc:328
| 11 10 ctools_context_handler_render_handler() /home/sam/www/gateway/docroot/sites/all/modules/contrib/ctools/includes/context-task-handler.inc:121
| 12 11 ctools_context_handler_render() /home/sam/www/gateway/docroot/sites/all/modules/contrib/ctools/includes/context-task-handler.inc:44
| 13 12 page_manager_page_execute() /home/sam/www/gateway/docroot/sites/all/modules/contrib/ctools/page_manager/plugins/tasks/page.inc:322
| 14 13 call_user_func_array() /home/sam/www/gateway/docroot/includes/menu.inc:0
| 15 14 menu_execute_active_handler() /home/sam/www/gateway/docroot/includes/menu.inc:517
| 16 15 {main}          /home/sam/www/gateway/docroot/index.php:21

Cheers,
Sam

Comments

merlinofchaos’s picture

Is the view and context pane you have to replicate this relatively simple? If so, exports might help a lot in tracing this one down.

samhassell’s picture

Quick response :)

Export below:

$view = new view();
$view->name = 'trending';
$view->description = '';
$view->tag = 'default';
$view->base_table = 'node';
$view->human_name = 'Trending';
$view->core = 7;
$view->api_version = '3.0';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */

/* Display: Master */
$handler = $view->new_display('default', 'Master', 'default');
$handler->display->display_options['title'] = 'Trending Content';
$handler->display->display_options['use_more'] = TRUE;
$handler->display->display_options['use_more_always'] = FALSE;
$handler->display->display_options['use_more_text'] = 'More trending content';
$handler->display->display_options['access']['type'] = 'perm';
$handler->display->display_options['cache']['type'] = 'none';
$handler->display->display_options['query']['type'] = 'views_query';
$handler->display->display_options['exposed_form']['type'] = 'basic';
$handler->display->display_options['pager']['type'] = 'full';
$handler->display->display_options['pager']['options']['items_per_page'] = '10';
$handler->display->display_options['style_plugin'] = 'grid';
$handler->display->display_options['style_options']['columns'] = '2';
$handler->display->display_options['row_plugin'] = 'node';
$handler->display->display_options['row_options']['view_mode'] = 'teaser_half';
$handler->display->display_options['row_options']['links'] = FALSE;
/* No results behavior: Global: Text area */
$handler->display->display_options['empty']['area']['id'] = 'area';
$handler->display->display_options['empty']['area']['table'] = 'views';
$handler->display->display_options['empty']['area']['field'] = 'area';
$handler->display->display_options['empty']['area']['empty'] = TRUE;
$handler->display->display_options['empty']['area']['content'] = 'There is no trending content';
$handler->display->display_options['empty']['area']['format'] = 'filtered_html';
/* Field: Content: Title */
$handler->display->display_options['fields']['title']['id'] = 'title';
$handler->display->display_options['fields']['title']['table'] = 'node';
$handler->display->display_options['fields']['title']['field'] = 'title';
$handler->display->display_options['fields']['title']['label'] = '';
$handler->display->display_options['fields']['title']['alter']['word_boundary'] = FALSE;
$handler->display->display_options['fields']['title']['alter']['ellipsis'] = FALSE;
/* Sort criterion: Content: Radioactivity (field_radioactivity:radioactivity_energy) */
$handler->display->display_options['sorts']['field_radioactivity_radioactivity_energy']['id'] = 'field_radioactivity_radioactivity_energy';
$handler->display->display_options['sorts']['field_radioactivity_radioactivity_energy']['table'] = 'field_data_field_radioactivity';
$handler->display->display_options['sorts']['field_radioactivity_radioactivity_energy']['field'] = 'field_radioactivity_radioactivity_energy';
$handler->display->display_options['sorts']['field_radioactivity_radioactivity_energy']['order'] = 'DESC';
/* Filter criterion: Content: Published */
$handler->display->display_options['filters']['status']['id'] = 'status';
$handler->display->display_options['filters']['status']['table'] = 'node';
$handler->display->display_options['filters']['status']['field'] = 'status';
$handler->display->display_options['filters']['status']['value'] = 1;
$handler->display->display_options['filters']['status']['group'] = 1;
$handler->display->display_options['filters']['status']['expose']['operator'] = FALSE;
/* Filter criterion: Content: Type */
$handler->display->display_options['filters']['type']['id'] = 'type';
$handler->display->display_options['filters']['type']['table'] = 'node';
$handler->display->display_options['filters']['type']['field'] = 'type';
$handler->display->display_options['filters']['type']['value'] = array(
  'page' => 'page',
);
$handler->display->display_options['filters']['type']['expose']['operator_id'] = 'type_op';
$handler->display->display_options['filters']['type']['expose']['label'] = 'Type';
$handler->display->display_options['filters']['type']['expose']['operator'] = 'type_op';
$handler->display->display_options['filters']['type']['expose']['identifier'] = 'type';
$handler->display->display_options['filters']['type']['expose']['remember_roles'] = array(
  2 => '2',
  1 => 0,
  3 => 0,
  95 => 0,
  96 => 0,
  94 => 0,
  104 => 0,
  105 => 0,
  106 => 0,
  107 => 0,
  108 => 0,
  109 => 0,
  110 => 0,
  111 => 0,
);
/* Filter criterion: Content: Topics (field_topics) */
$handler->display->display_options['filters']['field_topics_tid']['id'] = 'field_topics_tid';
$handler->display->display_options['filters']['field_topics_tid']['table'] = 'field_data_field_topics';
$handler->display->display_options['filters']['field_topics_tid']['field'] = 'field_topics_tid';
$handler->display->display_options['filters']['field_topics_tid']['expose']['operator_id'] = 'field_topics_tid_op';
$handler->display->display_options['filters']['field_topics_tid']['expose']['label'] = 'Topics (field_topics)';
$handler->display->display_options['filters']['field_topics_tid']['expose']['operator'] = 'field_topics_tid_op';
$handler->display->display_options['filters']['field_topics_tid']['expose']['identifier'] = 'field_topics_tid';
$handler->display->display_options['filters']['field_topics_tid']['expose']['remember_roles'] = array(
  2 => '2',
  1 => 0,
  3 => 0,
  95 => 0,
  96 => 0,
  94 => 0,
  104 => 0,
  105 => 0,
  106 => 0,
  107 => 0,
  108 => 0,
  109 => 0,
  110 => 0,
  111 => 0,
);
$handler->display->display_options['filters']['field_topics_tid']['type'] = 'select';
$handler->display->display_options['filters']['field_topics_tid']['vocabulary'] = 'topics';
$handler->display->display_options['filters']['field_topics_tid']['hierarchy'] = 1;

/* Display: Trending */
$handler = $view->new_display('page', 'Trending', 'page');
$handler->display->display_options['defaults']['hide_admin_links'] = FALSE;
$handler->display->display_options['defaults']['use_more'] = FALSE;
$handler->display->display_options['defaults']['use_more_always'] = FALSE;
$handler->display->display_options['defaults']['use_more_always'] = FALSE;
$handler->display->display_options['use_more_always'] = FALSE;
$handler->display->display_options['defaults']['use_more_text'] = FALSE;
$handler->display->display_options['use_more_text'] = 'More trending content';
$handler->display->display_options['defaults']['header'] = FALSE;
/* Header: Global: Text area */
$handler->display->display_options['header']['area']['id'] = 'area';
$handler->display->display_options['header']['area']['table'] = 'views';
$handler->display->display_options['header']['area']['field'] = 'area';
$handler->display->display_options['header']['area']['content'] = 'Below is a list of popular content on the site over the last 24 hours.';
$handler->display->display_options['header']['area']['format'] = 'filtered_html';
$handler->display->display_options['path'] = 'trending2';

/* Display: Front Page Block */
$handler = $view->new_display('block', 'Front Page Block', 'block');
$handler->display->display_options['defaults']['title'] = FALSE;
$handler->display->display_options['title'] = 'Trending';
$handler->display->display_options['defaults']['hide_admin_links'] = FALSE;
$handler->display->display_options['defaults']['pager'] = FALSE;
$handler->display->display_options['pager']['type'] = 'some';
$handler->display->display_options['pager']['options']['items_per_page'] = '3';
$handler->display->display_options['pager']['options']['offset'] = '0';
$handler->display->display_options['defaults']['style_plugin'] = FALSE;
$handler->display->display_options['style_plugin'] = 'default';
$handler->display->display_options['defaults']['style_options'] = FALSE;
$handler->display->display_options['defaults']['row_plugin'] = FALSE;
$handler->display->display_options['row_plugin'] = 'ds';
$handler->display->display_options['row_options']['view_mode'] = 'one_liner_with_thumbnail';
$handler->display->display_options['row_options']['load_comments'] = 0;
$handler->display->display_options['row_options']['alternating'] = 0;
$handler->display->display_options['row_options']['grouping'] = 0;
$handler->display->display_options['row_options']['advanced'] = 0;
$handler->display->display_options['row_options']['delta_fieldset']['delta_fields'] = array();
$handler->display->display_options['row_options']['grouping_fieldset']['group_field'] = 'field_data_field_radioactivity|field_radioactivity_radioactivity_energy';
$handler->display->display_options['row_options']['default_fieldset']['view_mode'] = 'one_liner_with_thumbnail';
$handler->display->display_options['defaults']['row_options'] = FALSE;

/* Display: Dashboard Block */
$handler = $view->new_display('block', 'Dashboard Block', 'dash_block');
$handler->display->display_options['defaults']['pager'] = FALSE;
$handler->display->display_options['pager']['type'] = 'some';
$handler->display->display_options['pager']['options']['items_per_page'] = '5';
$handler->display->display_options['pager']['options']['offset'] = '0';
$handler->display->display_options['defaults']['style_plugin'] = FALSE;
$handler->display->display_options['style_plugin'] = 'default';
$handler->display->display_options['defaults']['style_options'] = FALSE;
$handler->display->display_options['defaults']['row_plugin'] = FALSE;
$handler->display->display_options['row_plugin'] = 'node';
$handler->display->display_options['row_options']['view_mode'] = 'one_liner_with_thumbnail';
$handler->display->display_options['row_options']['links'] = FALSE;
$handler->display->display_options['defaults']['row_options'] = FALSE;

/* Display: Context */
$handler = $view->new_display('ctools_context', 'Context', 'ctools_context_1');
$handler->display->display_options['style_plugin'] = 'ctools_context';
$handler->display->display_options['row_plugin'] = 'ds';
$handler->display->display_options['row_options']['view_mode'] = 'teaser_half';
$handler->display->display_options['row_options']['load_comments'] = 0;
$handler->display->display_options['row_options']['alternating'] = 0;
$handler->display->display_options['row_options']['grouping'] = 0;
$handler->display->display_options['row_options']['advanced'] = 0;
$handler->display->display_options['row_options']['delta_fieldset']['delta_fields'] = array();
$handler->display->display_options['row_options']['grouping_fieldset']['group_field'] = 'field_data_field_radioactivity|field_radioactivity_radioactivity_energy';
$handler->display->display_options['row_options']['default_fieldset']['view_mode'] = 'teaser_half';
$handler->display->display_options['defaults']['header'] = FALSE;
/* Header: Global: Text area */
$handler->display->display_options['header']['area']['id'] = 'area';
$handler->display->display_options['header']['area']['table'] = 'views';
$handler->display->display_options['header']['area']['field'] = 'area';
$handler->display->display_options['header']['area']['content'] = 'The following articles have been identified as important and timely.';
$handler->display->display_options['header']['area']['format'] = 'plain_html';
$handler->display->display_options['inherit_panels_path'] = '1';

samhassell’s picture

Replicated on a clean install.

Enabled page manager, panels and views content panes, views_ui and dependencies, all latest -dev versions.

1. Create a view with a context display. Do not add an exposed filter to it, do not add a header to it.

3. Create a custom panel page with a view context related to your view.

4. Add the view context panes to the panel page. Add header, rows & pager context panes.

5. View the page. You should get the error:

Notice: Undefined index: header in views_content_views_header_content_type_render() (line 32 of /home/sam/www/drupal/docroot/sites/all/modules/contrib/ctools/views_content/plugins/content_types/views_header.inc).
Notice: Undefined index: rows in views_content_views_row_content_type_render() (line 54 of /home/sam/www/drupal/docroot/sites/all/modules/contrib/ctools/views_content/plugins/content_types/views_row.inc).
Notice: Undefined index: pager in views_content_views_pager_content_type_render() (line 32 of /home/sam/www/drupal/docroot/sites/all/modules/contrib/ctools/views_content/plugins/content_types/views_pager.inc).

and the view will not render.

6. Go back to the view and add an exposed filter

7. Go back to the panel page again and it works.

Renee S’s picture

Confirmed, I ran into this bug, the process in #3 worked to get the view loading again.

alexkb’s picture

I'm also having this issue, but for some reason, the view isn't even showing up after I add a exposed form element to the panel. Have ended up giving up on views context and now just using a standard view display.

alexkb’s picture

Issue summary:View changes

typo