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

kiamlaluno - June 6, 2008 - 02:16
Title:database table projects and issues issue» Database bugs

The patch resolves also some other bugs, like a hook named book_access_enable() when it should be project_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()).

AttachmentSize
project_permissions_module.patch 3.13 KB

#2

kiamlaluno - June 6, 2008 - 02:17
Status:active» needs review

#3

hasbegun - February 13, 2009 - 21:15
Priority:normal» critical

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

kiamlaluno - February 14, 2009 - 01:08

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.

 
 

Drupal is a registered trademark of Dries Buytaert.