Closed (fixed)
Project:
Forum Access
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
5 Mar 2008 at 05:44 UTC
Updated:
24 Mar 2008 at 05:41 UTC
In forum_access.module on line 217 there is this SQL
db_query("SELECT acl_id from {acl} WHERE module = 'forum_access' AND name = %d", $form['tid']['#value'])
The type of name in the acl table is varchar, so you try to compare chars to an integer. Either the type in module acl should be changed to some integer type or the SQL rewritten to:
db_query("SELECT acl_id from {acl} WHERE module = 'forum_access' AND name = '%s'", $form['tid']['#value'])
^^^
I found this problem with postgres and don't know if the statement works on mysql.
Comments
Comment #1
salvisAh, the new PostgreSQL without implicit type conversions...
Thank you for reporting this.
{acl}.name is a string in order to allow client modules to use whatever they want. FA only uses the tid (a number), so I think the proper code should be
db_query("SELECT acl_id from {acl} WHERE module = 'forum_access' AND name = '%d'", $form['tid']['#value']);
Does that work for you?
BTW, yes, the current code does work with MySQL and all but the latest version of PostgreSQL, because they do automatic type conversions as needed.
Comment #2
salvisCommitted to HEAD and 5.x-1.x-dev.
Comment #3
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.