I've been trying to create a view that shows a user the 10 most recent comments to nodes they created. I was able to easily get the view working as I wanted. However, upon visiting the log, I noticed that for each result, I am returning the same 3 errors. So, each time someone sees this view 30 errors are added to the log. The errors I am getting are as follows.
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 '' at line 1 query: SELECT n.nid, n.vid, n.type, n.status, n.created, n.changed, n.comment, n.promote, n.sticky, r.timestamp AS revision_timestamp, r.title, r.body, r.teaser, r.log, r.format, u.uid, u.name, u.picture, u.data FROM drupal_node n INNER JOIN drupal_users u ON u.uid = n.uid INNER JOIN drupal_node_revisions r ON r.vid = n.vid WHERE in /home/writersc/public_html/includes/database.mysql.inc on line 174.
implode() [<a href='function.implode'>function.implode</a>]: Invalid arguments passed in /home/writersc/public_html/modules/node/node.module on line 565.
Invalid argument supplied for foreach() in /home/writersc/public_html/modules/node/node.module on line 561.
This is the view that I created, though I can get this to happen on any view that includes the "Comment: Comment" field. To test it, I even created a view that has nothing but the "Comment: Comment" field.
$view = new stdClass();
$view->name = 'ww_my_new_reviews';
$view->description = 'This allows members to quickly see which submissions of theirs have the newest comments';
$view->access = array (
);
$view->view_args_php = '';
$view->page = TRUE;
$view->page_title = 'My New Reviews';
$view->page_header = '';
$view->page_header_format = '1';
$view->page_footer = '';
$view->page_footer_format = '1';
$view->page_empty = '<p>YOU HAVE NO REVIEWS!!! BOO-HOO</p>';
$view->page_empty_format = '1';
$view->page_type = 'table';
$view->url = 'workshop/my-new-reviews';
$view->use_pager = TRUE;
$view->nodes_per_page = '10';
$view->block = TRUE;
$view->block_title = 'My New Reviews';
$view->block_header = '';
$view->block_header_format = '1';
$view->block_footer = '';
$view->block_footer_format = '1';
$view->block_empty = '<p>NO REVIEWS FOR YOU!</p>';
$view->block_empty_format = '1';
$view->block_type = 'table';
$view->nodes_per_block = '10';
$view->block_more = TRUE;
$view->block_use_page_header = FALSE;
$view->block_use_page_footer = FALSE;
$view->block_use_page_empty = FALSE;
$view->sort = array (
array (
'tablename' => 'comments',
'field' => 'timestamp',
'sortorder' => 'DESC',
'options' => 'normal',
),
);
$view->argument = array (
);
$view->field = array (
array (
'tablename' => 'node',
'field' => 'title',
'label' => 'Submission',
'handler' => 'views_handler_field_nodelink',
'options' => 'link',
),
array (
'tablename' => 'comments',
'field' => 'comment',
'label' => 'Comment/Review',
),
array (
'tablename' => 'comments',
'field' => 'name',
'label' => 'Reviewer',
),
array (
'tablename' => 'comments',
'field' => 'timestamp',
'label' => 'Date',
'handler' => 'views_handler_field_date_small',
),
);
$view->filter = array (
array (
'tablename' => 'node',
'field' => 'type',
'operator' => 'OR',
'options' => '',
'value' => array (
0 => 'workshop_sub',
),
),
array (
'tablename' => 'node',
'field' => 'currentuid',
'operator' => '=',
'options' => '',
'value' => '***CURRENT_USER***',
),
);
$view->exposed_filter = array (
);
$view->requires = array(comments, node);
$views[$view->name] = $view;
If this has already been addressed, I apologize, I couldn't find anything in search.
Any help would be greatly appreciated.
Comments
Comment #1
domesticat commentedClosed while closing all Views support requests with no activity for 6 months. If you still need help, you may re-open this issue at any time.