MantisBT - CDash
View Issue Details
0010767CDashpublic2010-05-27 09:312010-10-25 02:36
Hendrik Belitz 
Julien Jomier 
normalmajoralways
closedfixed 
1.6.4 
1.8 
0010767: Clicking on administration/Users in an arbitrary project leads to an error.
When trying to access the user administration of my project, I receive the attached error message.
This is the output of http://localhost/cdash/manageProjectRoles.php?projectid=1 [^]



Fatal error: Call to a member function fetch() on a non-object in /home/administrator/src/CDash/cdash/pdo.php on line 121
No tags attached.
Issue History
2010-05-27 09:31Hendrik BelitzNew Issue
2010-05-27 09:34Julien JomierStatusnew => assigned
2010-05-27 09:34Julien JomierAssigned To => Julien Jomier
2010-05-27 09:41Julien JomierNote Added: 0020836
2010-05-27 09:41Julien JomierStatusassigned => resolved
2010-05-27 09:41Julien JomierFixed in Version => 1.8
2010-05-27 09:41Julien JomierResolutionopen => fixed
2010-05-27 09:48Hendrik BelitzNote Added: 0020837
2010-05-27 09:48Hendrik BelitzStatusresolved => feedback
2010-05-27 09:48Hendrik BelitzResolutionfixed => reopened
2010-05-27 09:52Julien JomierNote Added: 0020838
2010-05-27 10:03Hendrik BelitzNote Added: 0020840
2010-05-27 10:12Julien JomierNote Added: 0020841
2010-05-27 10:15Hendrik BelitzNote Added: 0020842
2010-05-27 10:24Julien JomierStatusfeedback => closed
2010-05-27 10:24Julien JomierResolutionreopened => fixed

Notes
(0020836)
Julien Jomier   
2010-05-27 09:41   
If you change the following line in manageProjectRoles.php (around line 434)

'$sql = "SELECT DISTINCT author,emailtype,email FROM dailyupdate,dailyupdatefile'

by

'$sql = "SELECT DISTINCT author,emailtype,user.email FROM dailyupdate,dailyupdatefile'

(the 'email' becomes 'user.email')

Let me know
(0020837)
Hendrik Belitz   
2010-05-27 09:48   
I tried this without any effect. The error persists.
(0020838)
Julien Jomier   
2010-05-27 09:52   
Are you using MySQL or PgSQL?

Can you try to add this line after the query:

$query = pdo_query($sql);
add_last_sql_error('ManageProjectRole'); <-- Add this line

And reload the page. You should get a better description of the error. Thanks!
(0020840)
Hendrik Belitz   
2010-05-27 10:03   
I'm using PostgreSQL 8.3.

Using the code you suggested leads to the following error message:

SQL error in ManageProjectRole():ERROR: syntax error at ».« LINE 1: SELECT DISTINCT author,emailtype,user.email FROM dailyupdate... ^
(0020841)
Julien Jomier   
2010-05-27 10:12   
Ok, try replacing the query by this one:

---
$sql = "SELECT DISTINCT author,emailtype,".qid("user").".email FROM dailyupdate,dailyupdatefile
            LEFT JOIN user2project ON (dailyupdatefile.author=user2project.cvslogin
            AND user2project.projectid=".qnum($project_array['id'])."
            )
            LEFT JOIN ".qid("user")." ON (user2project.userid=".qid("user").".id)
            WHERE
             dailyupdatefile.dailyupdateid=dailyupdate.id
             AND dailyupdate.projectid=".qnum($project_array['id']).
            " AND dailyupdatefile.checkindate>'".$date."' AND (emailtype=0 OR emailtype IS NULL)";
---
(0020842)
Hendrik Belitz   
2010-05-27 10:15   
Okay. Now it's working fine. Thank you very much.