projects
/
fusionforge
/
fusionforge.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
project home
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8367ee4
)
Avoid PHP warning when retrieving empty list of questions
author
Roland Mas
<lolando@debian.org>
Thu, 29 Aug 2013 14:07:48 +0000
(16:07 +0200)
committer
Roland Mas
<lolando@debian.org>
Thu, 29 Aug 2013 14:07:48 +0000
(16:07 +0200)
src/common/survey/SurveyQuestionFactory.class.php
patch
|
blob
|
history
diff --git
a/src/common/survey/SurveyQuestionFactory.class.php
b/src/common/survey/SurveyQuestionFactory.class.php
index ee3c23683496bfad2bed7b7736bda5c71a7b5904..c480f6562a36c495cbd5169466a19b0c4a9d52c3 100644
(file)
--- a/
src/common/survey/SurveyQuestionFactory.class.php
+++ b/
src/common/survey/SurveyQuestionFactory.class.php
@@
-89,6
+89,7
@@
class SurveyQuestionFactory extends Error {
}
$group_id = $this->Group->GetID();
}
$group_id = $this->Group->GetID();
+ $this->questions = array();
$result = db_query_params ('SELECT survey_questions.*,survey_question_types.type
FROM survey_questions,survey_question_types
WHERE survey_question_types.id=survey_questions.question_type
$result = db_query_params ('SELECT survey_questions.*,survey_question_types.type
FROM survey_questions,survey_question_types
WHERE survey_question_types.id=survey_questions.question_type
@@
-96,10
+97,7
@@
class SurveyQuestionFactory extends Error {
ORDER BY survey_questions.question_id ASC',
array ($group_id));
ORDER BY survey_questions.question_id ASC',
array ($group_id));
- if (!$result) {
- $this->setError(_('No Survey Question is found').db_error());
- return false;
- } else {
+ if ($result) {
while ($arr = db_fetch_array($result)) {
$this->questions[] = new SurveyQuestion($this->Group, $arr['question_id'], $arr);
}
while ($arr = db_fetch_array($result)) {
$this->questions[] = new SurveyQuestion($this->Group, $arr['question_id'], $arr);
}