After adding a list to Simplelist, I keep getting the following warning at the top of every page:

user warning: Table 'database_name.role' doesn't exist query: SELECT name FROM role WHERE rid IN (1,2,3) in path_to_drupal/sites/all/modules/simplelist/SimpleListController.php on line 122.

I substituted "database_name" instead of my own database. Likewise, "path_to_drupal" instead of the real path. Not sure if that was necessary, just being cautious.

Comments

reblevins’s picture

I just realized I have a special prefix in front of all my tables, so the above table name should be: database_name.my_prefix_role.

Not sure how to patch this, but maybe I'll give it a try.

reblevins’s picture

I went into the SimpleListController.php file and hard-coded my prefix on line 122:

$result = db_query("SELECT name FROM my_prefix_role WHERE rid IN (". db_placeholders($access) .")", $access);

I realize that this is not a very good fix, but it works for me. There must be a variable that I can put in there instead, but I don't even know where to start looking for something like that.

canen’s picture

Title: MySQL warning » Missing table prefix

The correct fix is to change the query to SELECT name FROM {role} WHERE... and Drupal will take care of the prefixing.

I changed the title to reflect what the real issue is.