I got unknown column error from MySQL as following:

"user warning: Unknown column 'node_node_data_field_building.tid' in 'on clause' query: SELECT node.nid AS nid, node.title AS node_title FROM node node LEFT JOIN content_type_model node_data_field_building ON node.vid = node_data_field_building.vid LEFT JOIN node node_node_data_field_building ON node_data_field_building.field_building_nid = node_node_data_field_building.nid INNER JOIN term_data node_node_data_field_building__term_data ON node_node_data_field_building.tid = node_node_data_field_building__term_data.tid WHERE (node.type in ('model')) AND (node_node_data_field_building__term_data.name = 'Singapore') LIMIT 0, 10 in var/www/sites/all/modules/views/includes/view.inc on line 723."


$view = new view;
$view->name = 'country';
$view->description = '';
$view->tag = '';
$view->view_php = '';
$view->base_table = 'node';
$view->is_cacheable = FALSE;
$view->api_version = 2;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->override_option('relationships', array(
  'field_building_nid' => array(
    'label' => 'Building',
    'required' => 0,
    'delta' => -1,
    'id' => 'field_building_nid',
    'table' => 'node_data_field_building',
    'field' => 'field_building_nid',
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'none',
  ),
));
$handler->override_option('fields', array(
  'title' => array(
    'label' => '',
    'link_to_node' => 1,
    'exclude' => 0,
    'id' => 'title',
    'table' => 'node',
    'field' => 'title',
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'none',
  ),
));
$handler->override_option('arguments', array(
  'name' => array(
    'default_action' => 'ignore',
    'style_plugin' => 'default_summary',
    'style_options' => array(),
    'wildcard' => 'all',
    'wildcard_substitution' => 'All',
    'title' => '',
    'default_argument_type' => 'fixed',
    'default_argument' => '',
    'validate_type' => 'none',
    'validate_fail' => 'not found',
    'glossary' => 0,
    'limit' => '0',
    'case' => 'none',
    'path_case' => 'none',
    'transform_dash' => 0,
    'add_table' => 0,
    'require_value' => 0,
    'id' => 'name',
    'table' => 'term_data',
    'field' => 'name',
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'field_building_nid',
    'default_options_div_prefix' => '',
    'default_argument_user' => 0,
    'default_argument_fixed' => '',
    'default_argument_php' => '',
    'validate_argument_node_type' => array(
      'faq' => 0,
      'forum' => 0,
      'building' => 0,
      'floorplan' => 0,
      'model' => 0,
      'page' => 0,
      'story' => 0,
    ),
    'validate_argument_node_access' => 0,
    'validate_argument_nid_type' => 'nid',
    'validate_argument_vocabulary' => array(
      '1' => 0,
      '4' => 0,
      '3' => 0,
      '2' => 0,
      '5' => 0,
    ),
    'validate_argument_type' => 'tid',
    'validate_argument_php' => '',
  ),
));
$handler->override_option('filters', array(
  'type' => array(
    'operator' => 'in',
    'value' => array(
      'model' => 'model',
    ),
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'type',
    'table' => 'node',
    'field' => 'type',
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'none',
  ),
));
$handler->override_option('access', array(
  'type' => 'none',
));
$handler->override_option('style_plugin', 'grid');
$handler->override_option('style_options', array(
  'columns' => '4',
  'alignment' => 'horizontal',
));
$handler = $view->new_display('page', 'Page', 'page_1');
$handler->override_option('path', 'country');
$handler->override_option('menu', array(
  'type' => 'none',
  'title' => '',
  'weight' => 0,
  'name' => 'navigation',
));
$handler->override_option('tab_options', array(
  'type' => 'none',
  'title' => '',
  'weight' => 0,
));

SELECT node.nid AS nid,
   node.title AS node_title
 FROM node node 
 LEFT JOIN content_type_model node_data_field_building ON node.vid = node_data_field_building.vid
 LEFT JOIN node node_node_data_field_building ON node_data_field_building.field_building_nid = node_node_data_field_building.nid
 INNER JOIN term_data node_node_data_field_building__term_data ON node_node_data_field_building.tid = node_node_data_field_building__term_data.tid
 WHERE (node.type in ('model')) AND (node_node_data_field_building__term_data.name = 'Singapore')

Comments

-Anti-’s picture

Please also see: http://drupal.org/node/325342

It's similar error when trying to use - 'upload: vocabulary' in a filter (and with other taxonomy filters/fields).

The weird thing is, Wordfallz can run the view without problem.
Which leads me to suspect it is something to do with SQL version/set-up, or Drupal upgrade path.
Tomorrow I'm going to set views2 up on a clean installation on the same server, and see if it works.

merlinofchaos’s picture

Status: Active » Fixed

Ok, the problem was that a table was being left out of the join. I reproduced and fixed this in CVS.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.