View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 05092 | Bug reports | Survey editing | public | 2011-04-06 19:53 | 2011-05-04 19:31 |
| Reporter | Assigned To | c_schmitz | |||
| Priority | normal | Severity | minor | ||
| Status | closed | Resolution | fixed | ||
| Fixed in Version | 1.91 | ||||
| Summary | 05092: Error during Preview of Questions that have replacement field from a previous question | ||||
| Description | Error is shown when trying to preview a question that has a replacement field from the answer of a previous question | ||||
| Steps To Reproduce | Version 1.9.2dev
| ||||
| Tags | No tags attached. | ||||
| Attached Files | replacementfield_questions_preview_error_patch.diff (909 bytes)
--- preview_orgnl.php 2011-04-06 14:12:40.691583000 +0530
+++ preview.php 2011-04-06 16:05:31.983582999 +0530
@@ -87,6 +87,18 @@
$question['class'] = question_class($qrows['type']);
$question['essentials'] = 'id="question'.$qrows['qid'].'"';
$question['sgq']=$ia[1];
+
+//Temporary fix for error condition arising from linked question via replacement fields
+//@todo: find a consistent way to check and handle this - I guess this is already handled but the wrong values are entered into the DB
+
+$search_for = '{INSERTANS';
+if(strpos($question['text'],$search_for)!==false){
+ $pattern_text = '/{([A-Z])*:([0-9])*X([0-9])*X([0-9])*}/';
+ $replacement_text = '[Dependancy on Another Question ID: $4]';
+ $text = preg_replace($pattern_text,$replacement_text,$question['text']);
+ $question['text']=$text;
+}
+
if ($qrows['mandatory'] == 'Y')
{
$question['man_class'] = ' mandatory';
| ||||
| Bug heat | 2 | ||||
| Complete LimeSurvey version number (& build) | 9971 | ||||
| I will donate to the project if issue is resolved | No | ||||
| Browser | Firefox3 | ||||
| Database type & version | MySQL 5.1 | ||||
| Server OS (if known) | Ubuntu 10.10 | ||||
| Webserver software & version (if known) | Apache2 | ||||
| PHP Version | 5.3.3 | ||||
|
I've attached a patch for this which currently handles the Error message - I guess it doesn't make sense to preview the question beforehand in this case, but it should fail gracefully without producing an Error message. I've handled this by doing a search for INSERTANS and proving a dependency message - the next step would be to give information of actual dependency question itself. Please let me know whether I've got this right, or whether I'm barking up the wrong bush :) |
|
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2011-04-06 19:53 |
|
New Issue | |
| 2011-04-06 19:59 |
|
File Added: replacementfield_questions_preview_error_patch.diff | |
| 2011-04-06 20:01 |
|
Note Added: 14706 | |
| 2011-04-06 23:35 | c_schmitz | Assigned To | => c_schmitz |
| 2011-04-06 23:35 | c_schmitz | Status | new => assigned |
| 2011-04-11 11:27 | c_schmitz | Status | assigned => resolved |
| 2011-04-11 11:27 | c_schmitz | Fixed in Version | => 1.91RC6 |
| 2011-04-11 11:27 | c_schmitz | Resolution | open => fixed |
| 2011-04-11 11:29 | c_schmitz | Fixed in Version | 1.91RC6 => 1.91 |
| 2011-05-04 19:31 | c_schmitz | Status | resolved => closed |
| 2019-11-01 17:25 | c_schmitz | Category | Survey design => Survey editing |