When I try to use the "or" in a search, I get a MySQL error. The query it's producing is below. I don't think the DISTINCT(DISTINCT(..)) bit is legal. Normal and-ed queries work fine.

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 workflow_node workflow_node ON no'

SELECT count(DISTINCT(DISTINCT(node.nid))) FROM node node LEFT JOIN workflow_node workflow_node ON node.nid = workflow_node.nid LEFT JOIN search_index search_index ON node.nid = search_index.sid LEFT JOIN users users ON node.uid = users.uid LEFT JOIN workflow_states workflow_states ON workflow_node.sid = workflow_states.sid WHERE (node.type IN ('content_kbdoc')) AND (workflow_node.sid IN ('10','3','4','11','12')) AND (node.status = '1') AND ((search_index.word = 'tinymce') OR (search_index.word = 'filter'))
CommentFileSizeAuthor
#2 views_query.patch556 bytesdouggreen

Comments

xjm’s picture

Just noticed, the table names are also doubled up.

douggreen’s picture

StatusFileSize
new556 bytes

This looks like a bug in views (in both 4.7 and 5.0). Please try the attached views patch, and if it solves the problem, I'll submit the issue to the views module maintainer. Thanks!

douggreen’s picture

See also 110462.

douggreen’s picture

Status: Active » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)