Revision: 545
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=545&view=rev
Author: mennodekker
Date: 2012-03-12 09:20:59 +0000 (Mon, 12 Mar 2012)
Log Message:
-----------
Fixed error with survey that does not exist (yet/anymore)
Modified Paths:
--------------
trunk/library/classes/Gems/Tracker/Survey.php
Modified: trunk/library/classes/Gems/Tracker/Survey.php
===================================================================
--- trunk/library/classes/Gems/Tracker/Survey.php 2012-03-09 15:05:30 UTC (rev 544)
+++ trunk/library/classes/Gems/Tracker/Survey.php 2012-03-12 09:20:59 UTC (rev 545)
@@ -191,9 +191,16 @@
public function checkRegistryRequestsAnswers()
{
if ($this->db && (! $this->_gemsSurvey)) {
- $this->_gemsSurvey = $this->db->fetchRow("SELECT * FROM gems__surveys WHERE gsu_id_survey = ?", $this->_surveyId);
+ $result = $this->db->fetchRow("SELECT * FROM gems__surveys WHERE gsu_id_survey = ?", $this->_surveyId);
+ if ($result) {
+ $this->_gemsSurvey = $result;
+ $this->exists = true;
+ } else {
+ //Row not present, try with empty array? or should we throw an error?
+ $this->_gemsSurvey = array();
+ $this->exists = false;
+ }
}
- $this->exists = $this->_surveyId > 0;
return (boolean) $this->_gemsSurvey;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|