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

salvis’s picture

Ah, 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.

salvis’s picture

Status: Active » Fixed

Committed to HEAD and 5.x-1.x-dev.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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