I get two error messages - I think it is caused by Workflow, but I'm not sure.
Situation: I have a view with 'Search: Search Terms' as exposed filter. Searches with 1 or 2 characters are not permitted, because of the search settings. When an anonymous user searches for a two letter word, the following messages appear:

- You must include at least one positive keyword with 3 characters or more.

- 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 'INNER JOIN inter_node_access na ON na.nid = node.nid WHERE (na.grant_view >= 1 A' at line 1 query: SELECT COUNT(*) FROM ( INNER JOIN inter_node_access na ON na.nid = node.nid WHERE (na.grant_view >= 1 AND ((na.gid = 0 AND na.realm = 'all') OR (na.gid = 1 AND na.realm = 'workflow_access') OR (na.gid = 0 AND na.realm = 'workflow_access_owner')))) count_alias in /var/www/naktuinbouw/sites/all/modules/views/includes/view.inc on line 729.

- 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 'INNER JOIN inter_node_access na ON na.nid = node.nid WHERE (na.grant_view >= 1 A' at line 1 query: INNER JOIN inter_node_access na ON na.nid = node.nid WHERE (na.grant_view >= 1 AND ((na.gid = 0 AND na.realm = 'all') OR (na.gid = 1 AND na.realm = 'workflow_access') OR (na.gid = 0 AND na.realm = 'workflow_access_owner'))) LIMIT 0, 10 in /var/www/naktuinbouw/sites/all/modules/views/includes/view.inc on line 755.

Thanks for your support.

Comments

dawehner’s picture

this looks like a completly empty query, but rewritten with node_db_rewrite_sql.

marcvangend’s picture

Status: Active » Fixed

OK, so that would mean that this problem is perhaps not workflow-related, but caused by another module trying to run a query. I'll look into it (if my colleague didn't fix it already). Marking this as fixed for now.

Status: Fixed » Closed (fixed)

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

miaoulafrite’s picture

hi, i also have the problem, i'm using workflow as well

did you found out anything on this issue yet?

thanks

rooby’s picture

Status: Closed (fixed) » Active

@marcvangend:
It's a long shot being so long ago but did you find a solution?

I have the same problem when I have an exposed filter and when it get's a validation error the view still runs because the view is passing an empty query into the db_rewrite_sql() function, which results in the views query being the access control query part only.
In my case the query is :

INNER JOIN {node_access} na ON na.nid = node.nid WHERE (na.grant_view >= 1 AND ((na.gid = 0 AND na.realm = 'all') OR (na.gid = 1 AND na.realm = 'workflow_access') OR (na.gid = 0 AND na.realm = 'workflow_access_owner'))) AND (((SELECT COUNT(1) FROM {node_access} nasq WHERE na.nid=nasq.nid AND gid=0 AND realm='all') > 0) OR ((SELECT COUNT(1) FROM {node_access} nasq WHERE na.nid=nasq.nid AND realm IN ('workflow_access','workflow_access_owner')) = 0 OR (SELECT COUNT(1) FROM {node_access} nasq WHERE na.nid=nasq.nid AND ((gid=1 AND realm='workflow_access') OR (gid=0 AND realm='workflow_access_owner'))) > 0))

That is the full sql for the view, which is why the error.
But why is it ending up like that?

rooby’s picture

Status: Active » Fixed

I found the problem - #571234: SQL error on views exposed filter autocomplete error handling

It was resolved in the views release 6.x-2.14

Status: Fixed » Closed (fixed)

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