Database bugs
Xavier Briand - March 3, 2008 - 10:10
| Project: | Project Permissions |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | needs review |
Description
in projects_permissions.module
line 98 missing {} around project_projects =>
$sql = "SELECT nid, uri FROM {project_projects}";
line 256 idem =>
$sql_issues = "SELECT nid FROM {project_issues} WHERE pid = %d";

#1
The patch resolves also some other bugs, like a hook named
book_access_enable()when it should beproject_permissions_enable(), or a private function that is named without to add the name of the module (_get_projects_list()versus_project_permissions_get_projects_list()).#2
#3
Another database related bug found.
If the drupal has a table prefix, this module doesn't work basically.
Line 98:
$sql = "SELECT nid, uri FROM project_projects";
must be changed to
$sql = "SELECT nid, uri FROM TABLE_PREFIX_project_projects";
Around 254:
SELECT nid FROM project_issues WHERE pid = %d
must be changed to
SELECT nid FROM TABLE_PREFIX_project_issues WHERE pid = %d
#4
That is not the correct way to name the database tables in Drupal SQL queries; the name of the table used should be
{project_projects}, and{project_issues}like Xavier Briand reported.