Closed (duplicate)
Project:
Views (for Drupal 7)
Version:
6.x-2.1
Component:
taxonomy data
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
23 Oct 2008 at 21:04 UTC
Updated:
25 Oct 2008 at 14:05 UTC
Can anyone give me a clue what might be the problem here:
$view = new view;
$view->name = 'test_downloads';
$view->description = '';
$view->tag = '';
$view->view_php = '';
$view->base_table = 'files';
$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(
'vid' => array(
'id' => 'vid',
'table' => 'upload',
'field' => 'vid',
),
));
$handler->override_option('fields', array(
'filename' => array(
'label' => 'Name',
'link_to_file' => 0,
'exclude' => 0,
'id' => 'filename',
'table' => 'files',
'field' => 'filename',
'override' => array(
'button' => 'Override',
),
'relationship' => 'none',
),
'filemime' => array(
'label' => 'Mime type',
'link_to_file' => 0,
'exclude' => 0,
'id' => 'filemime',
'table' => 'files',
'field' => 'filemime',
'override' => array(
'button' => 'Override',
),
'relationship' => 'none',
),
'filepath' => array(
'id' => 'filepath',
'table' => 'files',
'field' => 'filepath',
),
'filesize' => array(
'id' => 'filesize',
'table' => 'files',
'field' => 'filesize',
),
'title' => array(
'label' => 'Title',
'link_to_node' => 1,
'exclude' => 0,
'id' => 'title',
'table' => 'node',
'field' => 'title',
'override' => array(
'button' => 'Override',
),
'relationship' => 'vid',
),
));
$handler->override_option('filters', array(
'type' => array(
'operator' => 'in',
'value' => array(
'page' => 'page',
'story' => 'story',
),
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'id' => 'type',
'table' => 'node',
'field' => 'type',
'override' => array(
'button' => 'Override',
),
'relationship' => 'vid',
),
'vid' => array(
'operator' => 'in',
'value' => array(
'2' => '2',
'3' => '3',
),
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'id' => 'vid',
'table' => 'term_data',
'field' => 'vid',
'relationship' => 'vid',
),
));
$handler->override_option('access', array(
'type' => 'none',
));
$handler->override_option('style_plugin', 'table');
$handler = $view->new_display('page', 'Page', 'page_1');
$handler->override_option('path', 'downloads');
$handler->override_option('menu', array(
'type' => 'none',
'title' => '',
'weight' => 0,
'name' => 'navigation',
));
$handler->override_option('tab_options', array(
'type' => 'none',
'title' => '',
'weight' => 0,
));
produces the query:
SELECT files.fid AS fid,
files.filename AS files_filename,
files.filemime AS files_filemime,
files.filepath AS files_filepath,
files.filesize AS files_filesize,
node_upload.title AS node_upload_title,
node_upload.nid AS node_upload_nid
FROM files files
LEFT JOIN upload upload ON files.fid = upload.fid
LEFT JOIN node node_upload ON upload.vid = node_upload.vid
LEFT JOIN term_data node_upload__term_data ON node_upload.tid = node_upload__term_data.tid
WHERE (node_upload.type in ('page', 'story')) AND (node_upload__term_data.vid in ('2', '3'))
which gives the error:
user warning: Unknown column 'node_upload.tid' in 'on clause' query: SELECT files.fid AS fid, files.filename AS files_filename, files.filemime AS files_filemime, files.filepath AS files_filepath, files.filesize AS files_filesize, node_upload.title AS node_upload_title, node_upload.nid AS node_upload_nid FROM files files LEFT JOIN upload upload ON files.fid = upload.fid LEFT JOIN node node_upload ON upload.vid = node_upload.vid LEFT JOIN term_data node_upload__term_data ON node_upload.tid = node_upload__term_data.tid WHERE (node_upload.type in ('page', 'story')) AND (node_upload__term_data.vid in ('2', '3')) LIMIT 0, 10 in /home/USER/public_html/dev/sites/all/modules/views/includes/view.inc on line 723.
But WorldFallz can run this view without problem.
The following seems to be the key: Unknown column 'node_upload.tid'
A column appears to be missing from my database(?).
The site upgrade history is: D6.2 -> D6.3 -> D6.4 -> 6.5 -> 6.6, completely replacing files each time.
update.php was run each time, and the cache was emptied (using the performance page).
I'd be grateful for any suggestions.
Cheers.
Comments
Comment #1
merlinofchaos commentedThis looks like http://drupal.org/node/324513d
Comment #2
-Anti- commented> This looks like http://drupal.org/node/324513
Thanks for that. Yes, it looks remarkably similar.
I wonder if anyone knows what is going on?
Comment #3
merlinofchaos commentedI think I know what the bug is but it's going to be a bit before I can fix it
Comment #4
-Anti- commented> I think I know what the bug is but it's going to be a bit before I can fix it
Any idea why wordfallz can run the view, but I can't?
Can you reproduce the error yourself?
Is it to do with the way host's SQL is set-up to run the query?
Also, could you clarify what 'a bit' means? A few days, weeks or months?
Thanks a lot.