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
Comment #1
Roberto Gerola commentedThe 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.
Comment #2
steve.colson commentedI'm running 5.0.x latest for mysql; are there any other possible sources for this error?
Comment #3
Roberto Gerola commentedRun 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.
Comment #4
steve.colson commentedVia phpMyAdmin, it runs successfully and grabs (currently) 5 rows.
Comment #5
steve.colson commentedFound the problem. Not an issue of Storm, per se, but good to note what was happening.
http://drupal.org/node/288837
Comment #6
Roberto Gerola commentedInteresting, thanks.
I can fix it indeed adding some spaces here and there.
Thanks, Roberto
Comment #7
Roberto Gerola commentedI tried to fix it. Updated to cvs.
Let me know if it works for you.
Thanks, Roberto.
Comment #8
Roberto Gerola commentedComment #9
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.