My users are seeing the following error, but it isn't showing up for UID 1:
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 ') WHEN 'storminvoice' THEN 0 WHEN 'storminvoiceitem' THEN 0 else 1 end)=1) AN' at line 1 query: SELECT COUNT(*) FROM stormexpense sex1 WHERE sex1.vid=n.vid) WHEN 'storminvoice' THEN 0 WHEN 'storminvoiceitem' THEN 0 else 1 end)=1) AND ( (sti.ticketstatus IN ('inserted','in progress','on hold')) AND ( n.status=1 AND n.type='stormticket') ) in ...

and the complete sql:

SELECT n.nid, n.title, n.uid, n.changed, sti.project_title, sti.project_nid, sti.task_title, sti.task_nid, sti.ticketcategory, sti.ticketstatus FROM {node} AS n INNER JOIN {stormticket} AS sti ON n.vid=sti.vid WHERE ((case n.type WHEN 'stormexpense' THEN (SELECT IF(n.uid=12,1,0) FROM {stormexpense} sex1 WHERE sex1.vid=n.vid) WHEN 'storminvoice' THEN 0 WHEN 'storminvoiceitem' THEN 0 else 1 end)=1) AND ( (sti.ticketstatus IN ('inserted','in progress','on hold')) AND ( n.status=1 AND n.type='stormticket') )

Comments

Roberto Gerola’s picture

The complete SQL code is running fine on MySQL.
I think the error could be due to your MySQL version.

At now I have no easier solution to implement access control
but this.

steve.colson’s picture

I'm running 5.0.x latest for mysql; are there any other possible sources for this error?

Roberto Gerola’s picture

Run this SQL code :

SELECT n.nid, n.title, n.uid, n.changed, sti.project_title, sti.project_nid, sti.task_title, sti.task_nid, sti.ticketcategory, sti.ticketstatus FROM node AS n INNER JOIN stormticket AS sti ON n.vid=sti.vid WHERE ((case n.type WHEN 'stormexpense' THEN (SELECT IF(n.uid=12,1,0) FROM stormexpense sex1 WHERE sex1.vid=n.vid) WHEN 'storminvoice' THEN 0 WHEN 'storminvoiceitem' THEN 0 else 1 end)=1) AND ( (sti.ticketstatus IN ('inserted','in progress','on hold')) AND ( n.status=1 AND n.type='stormticket') )

on you MySQL db, through phpmyadmin for example, and let me know if it works or not.

Thanks.

steve.colson’s picture

Via phpMyAdmin, it runs successfully and grabs (currently) 5 rows.

steve.colson’s picture

Status: Active » Closed (fixed)

Found the problem. Not an issue of Storm, per se, but good to note what was happening.

http://drupal.org/node/288837

Roberto Gerola’s picture

Assigned: Unassigned » Roberto Gerola
Status: Closed (fixed) » Active

Interesting, thanks.
I can fix it indeed adding some spaces here and there.

Thanks, Roberto

Roberto Gerola’s picture

I tried to fix it. Updated to cvs.
Let me know if it works for you.

Thanks, Roberto.

Roberto Gerola’s picture

Status: Active » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

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