Mysql error with Views

Created on 12 December 2009, over 15 years ago
Updated 5 May 2025, 28 days ago

All was well on my new site until I activated TAC_lite. I get this error when a user without permission to see a particular content type classified with a taxonomy vocabulary opens a View designed to list items of that content type. Is this a conflict between TAC_lite and Views?

Here's the error:

An illegal choice has been detected. Please contact the site administrator.
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 node_access na ON na.nid = node.nid WHERE (na.grant_view >= 1 AND ((n' at line 1 query: SELECT COUNT(*) FROM ( 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 = 2 AND na.realm = 'forum_access') OR (na.gid = 8 AND na.realm = 'forum_access') OR (na.gid = 0 AND na.realm = 'tac_lite') OR (na.gid = 31 AND na.realm = 'tac_lite') OR (na.gid = 31 AND na.realm = 'tac_lite') OR (na.gid = 32 AND na.realm = 'tac_lite') OR (na.gid = 31 AND na.realm = 'tac_lite') OR (na.gid = 32 AND na.realm = 'tac_lite')))) count_alias in C:\wamp\www\sites\all\modules\views\includes\view.inc on line 739.
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 node_access na ON na.nid = node.nid WHERE (na.grant_view >= 1 AND ((n' at line 1 query: 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 = 2 AND na.realm = 'forum_access') OR (na.gid = 8 AND na.realm = 'forum_access') OR (na.gid = 0 AND na.realm = 'tac_lite') OR (na.gid = 31 AND na.realm = 'tac_lite') OR (na.gid = 31 AND na.realm = 'tac_lite') OR (na.gid = 32 AND na.realm = 'tac_lite') OR (na.gid = 31 AND na.realm = 'tac_lite') OR (na.gid = 32 AND na.realm = 'tac_lite'))) LIMIT 0, 10 in C:\wamp\www\sites\all\modules\views\includes\view.inc on line 765.

A friend looked at this and said:

it looks like tac_lite is broken. I'm not sure I know how to fix it (whatever it is in tac_lite that is generating the SQL is just generating broken SQL).

The outer statement in the SQL query:

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 = 2 AND na.realm = 'forum_access') OR
(na.gid = 8 AND na.realm = 'forum_access') OR
(na.gid = 0 AND na.realm = 'tac_lite') OR
(na.gid = 31 AND na.realm = 'tac_lite') OR
(na.gid = 32 AND na.realm = 'tac_lite') OR
(na.gid = 31 AND na.realm = 'tac_lite') OR
(na.gid = 32 AND na.realm = 'tac_lite'))
)
LIMIT 0, 10

is INNER JOIN, which can't be right, because JOINs can only ever be part of SELECTs, UPDATEs and DELETEs - in effect, the query doesn't tell the database to do anything

🐛 Bug report
Status

Closed: outdated

Version

1.3

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024