I created a view that displays the latest comment from a node in a list. The view throws the following error, but everything displays properly. I appreciate any help that can be offered with this, as the view seems to work right, it just throws this nasty error:

* warning: Invalid argument supplied for foreach() in C:\Web\Server\htdocs\d53\modules\node\node.module on line 521.
* warning: implode() [function.implode]: Bad arguments. in C:\Web\Server\htdocs\d53\modules\node\node.module on line 525.
* 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 '' 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 node n INNER JOIN users u ON u.uid = n.uid INNER JOIN node_revisions r ON r.vid = n.vid WHERE in C:\Web\Server\htdocs\d53\includes\database.mysql.inc on line 172.

This is the export of my view:

  $view = new stdClass();
  $view->name = 'whatsnew_pitch';
  $view->description = '';
  $view->access = array (
  0 => '2',
);
  $view->view_args_php = '';
  $view->page = TRUE;
  $view->page_title = 'My Pitches';
  $view->page_header = '';
  $view->page_header_format = '1';
  $view->page_footer = '';
  $view->page_footer_format = '1';
  $view->page_empty = '';
  $view->page_empty_format = '1';
  $view->page_type = 'list';
  $view->url = 'mypitch1';
  $view->use_pager = TRUE;
  $view->nodes_per_page = '5';
  $view->sort = array (
  );
  $view->argument = array (
  );
  $view->field = array (
    array (
      'tablename' => 'node',
      'field' => 'title',
      'label' => '',
      'handler' => 'views_handler_field_nodelink',
      'options' => 'link',
    ),
    array (
      'tablename' => 'comments',
      'field' => 'comment',
      'label' => '',
    ),
    array (
      'tablename' => 'comments',
      'field' => 'name',
      'label' => '',
    ),
    array (
      'tablename' => 'comments',
      'field' => 'timestamp',
      'label' => '',
      'handler' => 'views_handler_field_since',
    ),
  );
  $view->filter = array (
    array (
      'tablename' => 'node',
      'field' => 'type',
      'operator' => 'OR',
      'options' => '',
      'value' => array (
  0 => 'hell_pitch',
),
    ),
    array (
      'tablename' => 'node',
      'field' => 'currentuid',
      'operator' => '=',
      'options' => '',
      'value' => '***CURRENT_USER***',
    ),
  );
  $view->exposed_filter = array (
  );
  $view->requires = array(node, comments);
  $views[$view->name] = $view;

Comments

stg11’s picture

I am getting the same thing. It was working before. I have upgraded to Drupal 5.3 and Views 5-1.6 and it's getting same results as above. I am using a table view to show body of node and comment text side by side..

emdalton’s picture

I'm getting the same thing on Drupal 5.10, even though my view doesn't involve comments. My users are getting pretty irritated. It doesn't occur with all search terms, and I can't see a pattern in the search terms it does occur with, even after several months of collecting data. :(

merlinofchaos’s picture

Status: Active » Closed (won't fix)

This will not be fixed in Views 1.