Using the views tracker, it works great with the argument set up as default with the Argument as 'User: UID is Author.

I wanted to expand it to more like the core module tracker and get all the posting activity, not just authored posts. so i changed the argument to 'User: UID Authored or Commented'

well, clearly something does not like this as i got the following errors pitched back at me.

* user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DISTINCT(node.nid))) FROM node node LEFT JOIN comments comments ON node.nid = c' at line 1 query: SELECT count(DISTINCT(DISTINCT(node.nid))) FROM node node LEFT JOIN comments comments ON node.nid = comments.nid AND comments.uid = '2' LEFT JOIN comments comments2 ON node.nid = comments2.nid AND comments2.uid = '2' LEFT JOIN node_comment_statistics node_comment_statistics ON node.nid = node_comment_statistics.nid LEFT JOIN node_content_submission node_data_field_category ON node.vid = node_data_field_category.vid LEFT JOIN users users ON node.uid = users.uid WHERE (node.status = '1') AND (node.uid = '2' OR comments.uid = '2') AND (node.type IN ('content_cases','content_questions','content_submission')) AND (node.uid = '2' OR comments2.uid = '2') in /home/mysitec/public_html/includes/database.mysql.inc on line 120.
* user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DISTINCT(node.nid)), node.title AS node_title, node.changed AS node_changed, nod' at line 1 query: SELECT DISTINCT(DISTINCT(node.nid)), node.title AS node_title, node.changed AS node_changed, node_data_field_category.field_category_value AS node_data_field_category_field_category_value, users.name AS users_name, users.uid AS users_uid, node_comment_statistics.comment_count AS node_comment_statistics_comment_count, node_comment_statistics.last_comment_timestamp AS node_comment_statistics_last_comment_timestamp FROM node node LEFT JOIN comments comments ON node.nid = comments.nid AND comments.uid = '2' LEFT JOIN comments comments2 ON node.nid = comments2.nid AND comments2.uid = '2' LEFT JOIN node_comment_statistics node_comment_statistics ON node.nid = node_comment_statistics.nid LEFT JOIN node_content_submission node_data_field_category ON node.v in /home/mysitec/public_html/includes/database.mysql.inc on line 120.

is this a problem with my argument? or views?

thanks!

jason

Comments

merlinofchaos’s picture

Hmm. That doesn't happen for me. Can you export your view? There's something wonky going on there, with a 2nd comments table being added to the view and then it's getting DISTINCT twice. So there's more to it than just the argument.

And what version of Views are you actually using?

jbhan’s picture

thanks for the response,

I am using "views.module,v 1.159.2.25 2006/12/20" and drupal 4.7.2

here is my exported view - its the same as the generic tracker with the argument changed:

$view = new stdClass();
$view->name = 'tracker2';
$view->description = 'Shows all new activity on system by a certain user';
$view->access = array (
0 => '3',
1 => '2',
2 => '4',
3 => '5',
);
$view->view_args_php = '';
$view->page = TRUE;
$view->page_title = 'Recent posting activity by %1';
$view->page_header = '';
$view->page_header_format = '1';
$view->page_footer = '';
$view->page_footer_format = '1';
$view->page_empty = 'No posts by this User.';
$view->page_empty_format = '1';
$view->page_type = 'table';
$view->url = 'tracker2';
$view->use_pager = TRUE;
$view->nodes_per_page = '25';
$view->menu = TRUE;
$view->menu_title = 'recent posts';
$view->menu_tab = FALSE;
$view->menu_tab_default = FALSE;
$view->menu_tab_weight = '0';
$view->sort = array (
array (
'tablename' => 'node_comment_statistics',
'field' => 'last_comment_timestamp',
'sortorder' => 'DESC',
'options' => 'normal',
),
);
$view->argument = array (
array (
'type' => 'uidtouch',
'argdefault' => '2',
'title' => 'recent posts for %1',
'options' => '',
'wildcard' => '',
'wildcard_substitution' => '',
),
);
$view->field = array (
array (
'tablename' => 'node',
'field' => 'title',
'label' => 'Title',
'handler' => 'views_handler_field_nodelink_with_mark',
'options' => 'link',
),
array (
'tablename' => 'users',
'field' => 'name',
'label' => 'Author',
'sortable' => '1',
),
array (
'tablename' => 'node_comment_statistics',
'field' => 'comment_count',
'label' => 'Comments',
'handler' => 'views_handler_field_int',
),
array (
'tablename' => 'node_comment_statistics',
'field' => 'last_comment_timestamp',
'label' => 'Last Activity',
'handler' => 'views_handler_field_since',
),
);
$view->filter = array (
array (
'tablename' => 'node',
'field' => 'status',
'operator' => '=',
'options' => '',
'value' => '1',
),
array (
'tablename' => 'node',
'field' => 'type',
'operator' => 'OR',
'options' => '',
'value' => array (
0 => 'content_cases',
1 => 'content_questions',
2 => 'content_submission',
),
),
array (
'tablename' => 'node',
'field' => 'distinct',
'operator' => '=',
'options' => '',
'value' => array (
),
),
);
$view->exposed_filter = array (
);
$view->requires = array(node_comment_statistics, node, users);
$views[$view->name] = $view;

I have tried a few variations, including removing some of the fields from the view, but they all return the same error.

thanks!

jason

merlinofchaos’s picture

Crazy! When I import that view, it works flawlessly. I have no explanation for why it is not working for you. :/

(One minor nit: Your page title includes a %1, but with your argument settings, you can easily get a title without an argument. You should only have the %1 in the title attached to the argument).

merlinofchaos’s picture

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

updated to newest views, 1.5 and the issue seems resolved.

j

merlinofchaos’s picture

Status: Postponed (maintainer needs more info) » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)