Fixed bug reported by gregor: Too many authors are shown (form other conferences...
authorPhilipp Spitzer <philipp@spitzer.priv.at>
Fri, 24 Jun 2011 15:39:10 +0000 (15:39 +0000)
committerPhilipp Spitzer <philipp@spitzer.priv.at>
Fri, 24 Jun 2011 15:39:10 +0000 (15:39 +0000)
BUGS
src/mvc/event.cpp

diff --git a/BUGS b/BUGS
index f2a6b426a9e58d6c2b4bfed457febf8b9d7f3cfc..e1c993846c752bd653d91c0d2dfe4edfe46bb829 100644 (file)
--- a/BUGS
+++ b/BUGS
@@ -2,11 +2,11 @@ We don't have a bug tracking system yet, therefore this file contains known bugs
 
 
 -------------------------------------------------------------------
-BugId: 1
+BugID: 1
 Title: Persons are not deleted when deleting a conference.
 Status: Fixed.
 -------------------------------------------------------------------
-BugId: 2
+BugID: 2
 Title: SQL injections possible.
 Status: Fixed.
 -------------------------------------------------------------------
@@ -20,3 +20,8 @@ Title: Make links in event detail view clickable.
 Severity: wishlist
 Status:
 -------------------------------------------------------------------
+BugID 5
+Title: Too many authors are shown (from other conferences).
+Severity: major
+Status: Fixed.
+-------------------------------------------------------------------
index ed2c0cce7b1caa816d687f9665f5882b28ca1212..b70cf7aaa27ed8770188824a9ca64b1efd25bb6d 100644 (file)
@@ -157,13 +157,11 @@ QStringList Event::persons()
     if( mPersonsList.isEmpty() )
     {
         QSqlQuery query;
-        // TODO: conference ID isn't used here
-        query.prepare("SELECT person.name FROM person INNER JOIN event_person ON person.id = event_person.xid_person AND event_person.xid_event = :id AND event_person.xid_conference = :conf");
+        query.prepare("SELECT person.name FROM person INNER JOIN event_person ON person.id = event_person.xid_person AND event_person.xid_event = :id AND event_person.xid_conference = :conf1 AND person.xid_conference = :conf2");
         query.bindValue(":id", id());
-        query.bindValue(":conf", conferenceId());
-        query.exec();
-        // TODO: handle qeury error
-        //qDebug() << query.lastError();
+        query.bindValue(":conf1", conferenceId());
+        query.bindValue(":conf2", conferenceId());
+        if (!query.exec())  qDebug() << query.lastError();
 
         while(query.next())
             mPersonsList.append(query.record().value("name").toString());
@@ -226,7 +224,7 @@ QList<Event> Event::getSearchResultByDate(const QDate& date, int conferenceId, Q
 {
     QString strQuery = QString("SELECT %1 FROM EVENT INNER JOIN SEARCH_EVENT USING (xid_conference, id) ").arg(columnsForSelect());
     strQuery += QString("WHERE xid_conference = :conf AND start >= :start AND start < :end ORDER BY %1").arg(orderBy);
-    //qDebug() << strQuery;
+
     QList<Event> list;
     QSqlQuery query;
     try{