View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 05439 | Bug reports | Survey taking | public | 2011-09-01 16:11 | 2011-09-07 09:16 |
| Reporter | ronvdburg | Assigned To | c_schmitz | ||
| Priority | high | Severity | partial_block | ||
| Status | closed | Resolution | fixed | ||
| Product Version | 1.91+ | ||||
| Fixed in Version | 1.91+ | ||||
| Summary | 05439: {TOKEN:ATTRIBUTE_1} is not replaced everywhere | ||||
| Description | I used {TOKEN:ATTRIBUTE_1} in the question text. However, the token attribute replacement is NOT done in exporting the answers to pdf (PDF Export). | ||||
| Steps To Reproduce | Make sure you have a survey with at least 1 (user defined) attribute. | ||||
| Additional Information | Could you please have repaired this today, my customer wants to send out the survey tomorrow. If not possible, can you give me a hint to fix it myself (and uploading the patch)? I see there exists a tokenReplace function in replacements.php. | ||||
| Tags | No tags attached. | ||||
| Attached Files | printanswers.php.svn-diff.txt (1,453 bytes)
Index: printanswers.php
===================================================================
--- printanswers.php (revision 10920)
+++ printanswers.php (working copy)
@@ -224,7 +224,7 @@
{
if(isset($_POST['printableexport']))
{
- $pdf->intopdf(FlattenText($fname[0].$fname[1],true).": ".$fname[2]);
+ $pdf->intopdf(FlattenText(tokenReplace($fname[0].$fname[1]),true).": ".$fname[2]);
$pdf->ln(2);
}
else
Index: admin/printablesurvey.php
===================================================================
--- admin/printablesurvey.php (revision 10920)
+++ admin/printablesurvey.php (working copy)
@@ -779,7 +779,7 @@
$question = array(
'QUESTION_NUMBER' => $total_questions // content of the question code field
,'QUESTION_CODE' => $deqrow['title']
- ,'QUESTION_TEXT' => preg_replace('/(?:<br ?\/?>|<\/(?:p|h[1-6])>)$/is' , '' , $deqrow['question']) // content of the question field
+ ,'QUESTION_TEXT' => preg_replace('/(?:<br ?\/?>|<\/(?:p|h[1-6])>)$/is' , '' , tokenReplace($deqrow['question'])) // content of the question field
,'QUESTION_SCENARIO' => $explanation // if there are conditions on a question, list the conditions.
,'QUESTION_MANDATORY' => '' // translated 'mandatory' identifier
,'QUESTION_ID' => $deqrow['qid'] // id to be added to wrapping question div
| ||||
| Bug heat | 4 | ||||
| Complete LimeSurvey version number (& build) | 10746 | ||||
| I will donate to the project if issue is resolved | No | ||||
| Browser | |||||
| Database type & version | mysql 14.12 | ||||
| Server OS (if known) | Centos 2.2.3 (Linux version 2.6.18-194.3.1.el5) | ||||
| Webserver software & version (if known) | Apache/2.2.3 (CentOS) | ||||
| PHP Version | 5.1.6 | ||||
|
Hi ronvdburg are you a donator? |
|
|
No, not with money, but I donate all the patches that I need (and are paid) by my customer. |
|
|
ok, will have a look |
|
|
Hi Carsten, I found the issue and repaired it for my survey. The patch only does a tokenReplace in the question text; if you would like to also replace token fields elsewhere (e.g. the Group text), please let me know and I will send a new patch / svn-diff. Regards, Ron |
|
|
Thank you. No further patch is needed for that because the replacement functions will be completel rewritten in the next version. |
|
|
New version released |
|
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2011-09-01 16:11 | ronvdburg | New Issue | |
| 2011-09-01 18:51 | c_schmitz | Note Added: 16188 | |
| 2011-09-01 18:51 | c_schmitz | Assigned To | => c_schmitz |
| 2011-09-01 18:51 | c_schmitz | Status | new => feedback |
| 2011-09-01 19:29 | ronvdburg | Note Added: 16191 | |
| 2011-09-01 19:29 | ronvdburg | Status | feedback => assigned |
| 2011-09-01 21:22 | c_schmitz | Note Added: 16192 | |
| 2011-09-02 13:57 | ronvdburg | File Added: printanswers.php.svn-diff.txt | |
| 2011-09-02 14:01 | ronvdburg | Note Added: 16208 | |
| 2011-09-02 17:27 | c_schmitz | Note Added: 16215 | |
| 2011-09-02 17:27 | c_schmitz | Status | assigned => resolved |
| 2011-09-02 17:27 | c_schmitz | Fixed in Version | => 1.91+ |
| 2011-09-02 17:27 | c_schmitz | Resolution | open => fixed |
| 2011-09-07 09:16 | c_schmitz | Note Added: 16242 | |
| 2011-09-07 09:16 | c_schmitz | Status | resolved => closed |