When I apply the filter "Content translation: Source translation" in a view, it exploits an show me an error:

SQLSTATE[42000]: Syntax error or access violation: 1064 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 '.tnid0 IS NULL )' at line 1

If I see the SQL query generated, there is a big error in its syntax:

WHERE (( (node.tnidnode.nidORnode.tnid0 IS NULL )

CommentFileSizeAuthor
#1 filter-node-tnid-1224630-1.patch1.19 KBrvilar

Comments

rvilar’s picture

Status: Active » Needs review
StatusFileSize
new1.19 KB

There was a problem in the function used to make the query. It used:

$this->query->add_where($this->options['group'], "$table.tnid = $table.nid" . ($this->operator ? " OR $table.tnid = 0" : ''));

But the correct form is:

$this->query->add_where_expression($this->options['group'], "$table.tnid = $table.nid" . ($this->operator ? " OR $table.tnid = 0" : ''));

dawehner’s picture

Priority: Critical » Major
Status: Needs review » Fixed

That's not that critical from my perspective because it's just a certain part of views.

Anyway commited to 7.x-3.x, because it looks clearly as bug and solution.

Status: Fixed » Closed (fixed)

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