SQL Error

craigdurling - September 25, 2007 - 02:15
Project:Image Gallery Access
Version:5.x-1.x-dev
Component:User interface
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

I'm seeing these types of errors in the logs when site users post or view images

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 ';)' at line 1 query: SELECT tid FROM term_node INNER JOIN node_access na ON na.nid = n.nid WHERE (na.grant_view >= 1 AND ((na.gid = 0 AND na.realm = 'all') OR (na.gid = 3 AND na.realm = 'content_access_author') OR (na.gid = 2 AND na.realm = 'content_access_rid') OR (na.gid = 2 AND na.realm = 'image_gallery_access'))) AND ( nid = 210;)  in /var/www/vhosts/tritons.ca/httpdocs/includes/database.mysql.inc on line 172.

I suspect this may have something to do with the Image Gallery Access module but can't be certain. Any ideas?

#1

salvis - October 1, 2007 - 00:24

Thanks for reporting this. I haven't tested compatibility with Content Access yet.

Are you using both Image Gallery Access and Content Access for controlling access to images or are you using CA for other types of content only?

#2

salvis - October 6, 2007 - 12:00

You'll have to help me reproduce this...

I have Content Access 5.x-1.2 and the current IGA, as well as Image and Image Gallery 5.x-1.1.
/admin/content/types/image/access has per node access settings disabled and Viewing allowed for anonymous and authenticated users; node grants priority is 0.

IGA is set to allow Viewing to a specific role and Posting/Editing/Deleting to another specific role.

With this setup I can view and post images without getting any error messages.

#3

salvis - October 6, 2007 - 12:56

Another idea: try searching in your Drupal installation for the string

SELECT tid FROM {term_node}

Or even just for

{term_node}

and check whether the any of the statements or statement fragments could result in the query that you reported.

I checked my Drupal 5.2 installation, and I don't think that query is ever produced on my site.

Also try

ON na.nid = n.nid

This gives me one hit in content_access.module, but it's a different query. Maybe there's a third module involved that we haven't identified yet...

#4

salvis - November 17, 2007 - 19:43
Status:active» closed

Reopen the issue if it's still relevant.

#5

melvix - March 23, 2008 - 12:43

See http://drupal.org/node/45050#comment-642435 for a solution to this problem.

It's not related to image_gallery_access.

#6

salvis - March 23, 2008 - 13:33

Thanks!

 
 

Drupal is a registered trademark of Dries Buytaert.