Survey text entries are not registered correctly
- Status
- Pending
- Subject
- Survey text entries are not registered correctly
- Version
- 1.9.x
- Category
- Error
- Patch
- Feature
- Survey
- Submitted by
- mikaelk
- Rating
- Description
- A text entry to a survey question is not registered correctly if the same entry has already been registered to some other question. For example, if there is a survey on ID 1 with a text question and someone has answered "foobar" to that question and then another person takes survey on ID 2 and answers "foobar" to a text question in that survey no entry is registered. The problem can be replicated most easily but creating a survey with multiple text questions and answering for example "test" to all those questions. Only the first "text" is registered and the rest omitted.
- Solution
If I was able to track down the problem correctly the problem is the following line in /lib/surveys/surveylib.php:
Copy to clipboard$cant = $this->getOne("select count(*) from `tiki_survey_question_options` where `qoption`=?",array($value));
which should be changed to read:
Copy to clipboard$cant = $this->getOne("select count(*) from `tiki_survey_question_options` where `questionId`=? and `qoption`=?",array((int)$questionId,$value));- Importance
- 5
- Priority
- 25
- Demonstrate Bug on Tiki 19+
-
This bug has been demonstrated on show2.tiki.org
Please demonstrate your bug on show2.tiki.org
Show.tiki.org is not configured properlyThe public/private keys configured to connect to show2.tiki.org were not accepted. Please make sure you are using RSA keys. Thanks.
- Demonstrate Bug (older Tiki versions)
-
This bug has been demonstrated on show.tikiwiki.org
Please demonstrate your bug on show.tikiwiki.org
Show.tiki.org is not configured properlyThe public/private keys configured to connect to show.tikiwiki.org were not accepted. Please make sure you are using RSA keys. Thanks.
- Ticket ID
- 1648
- Created
- Thursday 20 March, 2008 21:12:48 UTC
by Unknown - LastModif
- Thursday 20 March, 2008 21:24:36 UTC