Closed (fixed)
Project:
Role Control
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
24 Sep 2007 at 00:55 UTC
Updated:
14 Jan 2008 at 14:06 UTC
I am getting the following warning when updating user information or when a new user creates an account:
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 '' at line 1 query: SELECT * FROM users_roles WHERE uid = 2 AND rid = in /home/bedigiti/public_html/_theparadox/includes/database.mysql.inc on line 172.
The relevant code appears to be:
/**
* Supporting functions
*/
function _role_control_grant_role($user, $roleid) {
// Verify this user isn't in this role already
$result = db_query("SELECT * FROM {users_roles} WHERE uid = $user->uid AND rid = $roleid");
$role_already_given = db_num_rows($result);
if (!$role_already_given) {
db_query('INSERT INTO {users_roles} (uid, rid) VALUES (%d, %d)', $user->uid, $roleid);
}
}
function _role_control_deny_role($user, $roleid) {
// Verify membership
$result = db_query("SELECT * FROM {users_roles} WHERE uid = $user->uid AND rid = $roleid");
$role_present = db_num_rows($result);
if ($role_present) {
db_query("DELETE FROM {users_roles} WHERE uid = %d AND rid = %d", $user->uid, $roleid);
}
}
Comments
Comment #1
elliot commentedcyrxi,
I'll try to take a look at this over the next few days. We don't have a setup where users can create new accounts, but I should be able to set something up. What version of Drupal are you using?
-Elliot
Comment #2
Carlos Miranda Levy commentedI installed it on one of my sites open to user registration and it works fine...
You may want to check other user related modules you may have installed...
Comment #3
elliot commentedSince I haven't heard anything and I haven't seen this I'm going to close this issue, please open another if you find that in error.
-Elliot