I was playing with views 2 and basically this is the first time I have installed and used it, I did read up wots relationships in views 2, rest of it looks more or less the same from functionality point of view, the UI is just KICKASS ..
so yeh I created a small view to see node body, comment body and user name
and when i clicked relationship it gave me only one field comment parent cid, I do not understand the relationship but I added it none the less, the resulting view is giving malformed mysql query error .. now i removed the relationship, it worked fine .. So the question is should it offer me a relationship on clicking add which forms a wrong query ?

I am copy pasting the export of the view ..
$view = new view;
$view->name = 'online_users';
$view->description = 'list of users who are online ';
$view->tag = '';
$view->view_php = '';
$view->base_table = 'users';
$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' => 'default',
'style_options' =>
array (
),
'row_plugin' => 'fields',
'row_options' =>
array (
),
'relationships' =>
array (
'pid' =>
array (
'id' => 'pid',
'table' => 'comments',
'field' => 'pid',
'label' => 'Relationship test',
'required' => 0,
'relationship' => 'none',
),
),
'fields' =>
array (
'body' =>
array (
'id' => 'body',
'table' => 'node_revisions',
'field' => 'body',
'label' => 'Body',
'relationship' => 'none',
),
'name_1' =>
array (
'id' => 'name_1',
'table' => 'users',
'field' => 'name',
'label' => 'Name',
'link_to_user' => 1,
'relationship' => 'none',
),
'comment' =>
array (
'id' => 'comment',
'table' => 'comments',
'field' => 'comment',
'label' => 'comment body',
'relationship' => 'none',
),
),
'sorts' =>
array (
),
'arguments' =>
array (
),
'filters' =>
array (
'status' =>
array (
'id' => 'status',
'table' => 'users',
'field' => 'status',
'operator' => '=',
'value' => 1,
'group' => 0,
'exposed' => false,
'expose' =>
array (
'operator' => false,
'label' => '',
),
'relationship' => 'none',
'expose_button' =>
array (
'button' => 'Expose',
),
),
),
'items_per_page' => 10,
'use_ajax' => '1',
);
$view->display['default'] = $display;
$display = new views_display;
$display->id = 'page';
$display->display_title = 'Page';
$display->display_plugin = 'page';
$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 (
),
'path' => 'online_users',
'menu' =>
array (
'type' => 'normal',
'title' => 'Testing view',
'weight' => '0',
),
);
$view->display['page'] = $display;

Thanks, and please excuse me if this doesn't qualify to be a valid issue, As I was just playing ..

CommentFileSizeAuthor
Screenshot.png157.42 KBdipen chaudhary
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dipen chaudhary’s picture

aaah and ignore the name of the view, I got lost in myriad of options and in haste ended up making which i didnt intend intitially ..

RoboPhred’s picture

I can confirm this happens on the latest HEAD version.

The error seems to be on the line
LEFT JOIN drupal6_comment pid ON comments.pid = pid.

The last part: "pid." doesn't look right.

(and it would be very helpful if you could make the "live preview" query text selectable so I could copy it in, rather than retyping it between windows.)

merlinofchaos’s picture

Status: Active » Fixed

This relationship should not have been available on a users view.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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