hi all,

this is my argument handling code:

if (isset($args[0])) {
  views_view_add_filter($view, 'node', 'nid', '=', $args[0], '');
  views_sanitize_view($view);
}
return $args;

and get the following SQL-error:

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 '= '53') ORDER BY node_created_created DESC LIMIT 0, 10' at line 1 query: SELECT DISTINCT(node.nid), node.created AS node_created_created FROM node node LEFT JOIN term_node term_node ON node.nid = term_node.nid LEFT JOIN term_hierarchy term_hierarchy ON term_node.tid = term_hierarchy.tid WHERE (node.status = '1') AND (node.type IN ('story')) AND (term_node.tid IN ('3','15','14')) AND (.nid = '53') ORDER BY node_created_created DESC LIMIT 0, 10 in

it seems that the table name is not accepted.

Comments

mr.cake’s picture

I couldnt solve this problem but found a good workaround. Filtering by node-ids could be also done as jtomlinson described here: http://drupal.org/node/131482#comment-215435:

Assuming you are using Views module, add a "Node:ID" argument type to your view. In the Option dropdown, select "Not Equal". Then place the following in the Argument Handling Code:

if ( ($type=='block') && is_numeric(arg(1)) ){
$args[0] = arg(1);
}
return $args;

thanks jtomlinson for this post!

sun’s picture

Status: Active » Closed (won't fix)

Sorry, unfortunately this support request is way too specific. Please have a look at the issue queue - Views maintainers are buried already. You might want to try to get further support at http://drupal.org/support.
If you were able to solve this issue on your own in the meantime, you might want to add the involved steps to this closed issue, so other users searching for a similar solution might find it.

digitalfrontiersmedia’s picture

I don't know if this is still an issue in the most recent version or not, but for those still experiencing it, the reason (and suggested patch) for this bug is here:

http://drupal.org/node/150517