I'm not sure if this is a views or a CCK issue, I've also posted it under CCK.

I have one content type (products) that references another (colour_options) via a select list. I need the list to display more than just the title of the nodes. So I created a view to retreive more data. Now I get an error when trying to add or edit products, or edit the field "field_colour_options". The error is:

Fatal error: Call to a member function render() on a non-object in C:\blahblahblah\sites\all\modules\views\theme\theme.inc on line 168

The view is working fine (when I look at the page version of it and in preview), and my content type was fine as a straight list. It only starts erroring when I use the view.

Comments

merlinofchaos’s picture

Can you please export the view and paste it here in between

tags?

yelloroadie’s picture


$view = new view;
$view->name = 'get_materials';
$view->description = 'gets list of all materials for display in product create/edit form';
$view->tag = '';
$view->view_php = '';
$view->base_table = 'node';
$view->is_cacheable = '0';
$view->api_version = 2;
$view->disabled = FALSE; // Edit this to true to make a default view disabled initially
$view->display = array();
  $display = new views_display;
  $display->id = 'default';
  $display->display_title = 'Defaults';
  $display->display_plugin = 'default';
  $display->position = '1';
  $display->display_options = array (
  'style_plugin' => 'list',
  'style_options' => 
  array (
    'type' => 'ul',
  ),
  'row_plugin' => 'fields',
  'row_options' => 
  array (
  ),
  'relationships' => 
  array (
  ),
  'fields' => 
  array (
    'nid' => 
    array (
      'id' => 'nid',
      'table' => 'node',
      'field' => 'nid',
      'label' => 'Nid',
    ),
    'title' => 
    array (
      'id' => 'title',
      'table' => 'node',
      'field' => 'title',
      'label' => 'Material',
      'relationship' => 'none',
      'link_to_node' => 0,
    ),
    'field_colour_name_value' => 
    array (
      'id' => 'field_colour_name_value',
      'table' => 'node_data_field_colour_name',
      'field' => 'field_colour_name_value',
      'label' => 'Colour',
      'format' => 'default',
      'multiple' => 
      array (
        'group' => true,
        'multiple_number' => '',
        'multiple_from' => '',
        'multiple_reversed' => false,
      ),
      'relationship' => 'none',
      'link_to_node' => 0,
    ),
  ),
  'sorts' => 
  array (
    'title' => 
    array (
      'id' => 'title',
      'table' => 'node',
      'field' => 'title',
      'order' => 'ASC',
      'relationship' => 'none',
    ),
    'field_colour_name_value' => 
    array (
      'id' => 'field_colour_name_value',
      'table' => 'node_data_field_colour_name',
      'field' => 'field_colour_name_value',
      'order' => 'ASC',
      'relationship' => 'none',
    ),
  ),
  'arguments' => 
  array (
  ),
  'filters' => 
  array (
    'type' => 
    array (
      'id' => 'type',
      'table' => 'node',
      'field' => 'type',
      'operator' => 'in',
      'value' => 
      array (
        'material' => 'material',
      ),
      'group' => 0,
      'exposed' => false,
      'expose' => 
      array (
        'operator' => false,
        'label' => '',
      ),
      'relationship' => 'none',
      'expose_button' => 
      array (
        'button' => 'Expose',
      ),
    ),
  ),
  'items_per_page' => 1000,
  'offset' => 0,
);
$view->display['default'] = $display;
  $display = new views_display;
  $display->id = 'block';
  $display->display_title = 'Block';
  $display->display_plugin = 'block';
  $display->position = '2';
  $display->display_options = array (
  'defaults' => 
  array (
    'access' => true,
    'title' => true,
    'header' => true,
    'header_format' => true,
    'header_empty' => true,
    'footer' => true,
    'footer_format' => true,
    'footer_empty' => true,
    'empty' => true,
    'empty_format' => true,
    'use_ajax' => true,
    'items_per_page' => true,
    'offset' => true,
    'use_pager' => true,
    'pager_element' => true,
    'use_more' => true,
    'distinct' => true,
    'link_display' => true,
    'style_plugin' => true,
    'style_options' => true,
    'row_plugin' => true,
    'row_options' => true,
    'relationships' => true,
    'fields' => true,
    'sorts' => true,
    'arguments' => true,
    'filters' => true,
  ),
  'relationships' => 
  array (
  ),
  'fields' => 
  array (
  ),
  'sorts' => 
  array (
  ),
  'arguments' => 
  array (
  ),
  'filters' => 
  array (
  ),
);
$view->display['block'] = $display;
  $display = new views_display;
  $display->id = 'page';
  $display->display_title = 'Page';
  $display->display_plugin = 'page';
  $display->position = '3';
  $display->display_options = array (
  'defaults' => 
  array (
    'access' => true,
    'title' => true,
    'header' => true,
    'header_format' => true,
    'header_empty' => true,
    'footer' => true,
    'footer_format' => true,
    'footer_empty' => true,
    'empty' => true,
    'empty_format' => true,
    'use_ajax' => true,
    'items_per_page' => true,
    'offset' => true,
    'use_pager' => true,
    'pager_element' => true,
    'use_more' => true,
    'distinct' => true,
    'link_display' => true,
    'style_plugin' => true,
    'style_options' => true,
    'row_plugin' => true,
    'row_options' => true,
    'relationships' => true,
    'fields' => true,
    'sorts' => true,
    'arguments' => true,
    'filters' => true,
  ),
  'relationships' => 
  array (
  ),
  'fields' => 
  array (
  ),
  'sorts' => 
  array (
  ),
  'arguments' => 
  array (
  ),
  'filters' => 
  array (
  ),
  'path' => 'get_materials',
);
$view->display['page'] = $display;


salopa’s picture

I have the problem too. Pls any resolution?

merlinofchaos’s picture

I *think* this is a CCK issue. Can you please paste the link to the CCK issue you filed?

merlinofchaos’s picture

Status: Active » Postponed (maintainer needs more info)
andershal’s picture

Same issue as a CCK bug: http://drupal.org/node/256440

--
Anders Hal

yelloroadie’s picture

I get a slightly larger error message after updating a few modules: now it shows the views query (sort of)?

SELECT node.nid AS nid,
   node.title AS node_title,
   node_data_field_colour_name.field_colour_name_value AS node_data_field_colour_name_field_colour_name_value,
   node_data_field_colour_name.nid AS node_data_field_colour_name_nid
 FROM {node} node 
 LEFT JOIN {content_type_material} node_data_field_colour_name ON node.vid = node_data_field_colour_name.vid
 WHERE (node.type in ('%s')) AND (UPPER(%s) LIKE UPPER('%%%s%%'))
   ORDER BY node_title ASC, node_data_field_colour_name_field_colour_name_value ASC


Fatal error: Call to a member function render() on a non-object in C:\Inetpub\wwwroot\juliedawson.com\httpdocs\current\sites\all\modules\views\theme\theme.inc on line 168

although that's not a valid query on it's own. I presume it's getting parsed somewhere/how before actually being run...? otherwise this could be the source of the error.

karens’s picture

Status: Postponed (maintainer needs more info) » Closed (duplicate)

The CCK issue has been marked fixed, and this appears to be a duplicate of that issue.