View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
20114 | Bug reports | Expression Manager | public | 2025-05-20 10:35 | 2025-09-19 10:14 |
Reporter | Mazi | Assigned To | adamzammit | ||
Priority | none | Severity | block | ||
Status | assigned | Resolution | open | ||
Product Version | 6.6.x | ||||
Summary | 20114: queXML export doesn't replace EM placeholders | ||||
Description | When enabling the "Print answers" feature at a survey, there is a "Export to queXML PDF" button shown. When exporting the given data set to queXML, EM placeholders do not get replaced and the export looks weird - actually you can not really use it, see attached screenshot. | ||||
Steps To Reproduce | Steps to reproduceImport and activate the attached survey. Expected resultReplace EM placeholders for given data set. Actual resultUnreadable EM syntax is still shown | ||||
Tags | No tags attached. | ||||
Attached Files | |||||
Bug heat | 10 | ||||
Complete LimeSurvey version number (& build) | 6.13.3 | ||||
I will donate to the project if issue is resolved | No | ||||
Browser | |||||
Database type & version | MariaDB 10.1.48 | ||||
Server OS (if known) | |||||
Webserver software & version (if known) | |||||
PHP Version | 8.2 | ||||
related to | 20139 | closed | adamzammit | Export as QueXML with debug 2 and 8.3.22 : throw error |
@adamzammit, not sure if you usually deal with such queXML stuff?! |
|
thanks @Mazi. Yes queXML is my area. If the user wants the queXML PDF export at the "print answers" functionality just for seeing their web responses on a form, it does make sense to execute/replace all the EM code. But if the user is using it to produce a semi-filled form to later use queXF to process the paper form, then processing the EM will likely break the form's compatibility with queXF as the variable nature will change the layout of the pages. I'm happy to make a change to execute the EM code, but my preference would be for it to be a configuration option that isn't the default. Would that suit you? Adam |
|
@adamzammit, I fully agree. This adjustment only makes sense for writing a single data set as PDF. We should be able to differentiate this from the other use cases so it would be great if you could look into this. |
|
@adamzammit, is there any news regarding a fix for this issue? The user is asking because they want to run a large study at the end of the month. |
|
thanks for checking in @Mazi. I've run into a bit of a roadblock. Processing EM for a response currently relies on the survey session being set. I can get it to process the EM for things like this {rand(0,100)} but for prefills response data I'm not sure if this can be done without messing around with session data |
|
@adamzammit, I think there is no other way then generating the session data for the given data set ID. But maybe @DenisChenu has some ideas on how to deal with this? |
|
It's the case when you came for Print answers after survey done. Maybe check if session is set, if yes : use Expresssion manager.
https://gitlab.com/SondagesPro/RemoteControl/RemoteManageResponse/-/blob/main/RemoteControlHandler.php?ref_type=heads#L193 |
|
hi @Mazi can you give this change a test and see what you think. https://github.com/LimeSurvey/LimeSurvey/compare/master...adamzammit:LimeSurvey:fix-20114 |
|
@DenisChenu - please reset the queXMLPDF export settings to default. This is unusual and I do not think it is related to this bug. |
|
@adamzammit : where i reset it ? |
|
Hi @DenisChenu: please go to the main export menu, choose queXML PDF export, then at the bottom of that page press the red "Reset Now" button. |
|
@adamzammit via discord :( |
|
@DenisChenu, have you been able to test the fix? |
|
@adamzammit, we replaced the two edited files at a 6.13 version but at our initial testing the placeholders have NOT been replaced. We may have done something wrong though... any hints on what else we should consider? |
|
But : the worst part : a big issue
Wait : Not update text OR updated with 1st response My opinion Maybe create a Feature Request to have a integrated way to start a survey by LimeSurvey core API after and use it here. |
|
@DenisChenu, "add it for subquestions and answers" is exactly what we were missing. At our example, sub-questions were using placeholders as can be seen at the screenshot we had added. So this still doesn't work. |
|
Here is a minimum survey that shows the problem in concrete terms. It takes me almost 2 minutes to generate the PDF. I have applied Adam's commit as a patch, but I get the same result as before https://github.com/LimeSurvey/LimeSurvey/commit/f2d90f065573a6141ed81d509d328541e1e20fbf.patch |
|
The lsa i upload is a 3 question for demonstration . With replacement on question, subquestion and answer text |
|
@adamzammit, the fix for question texts looks promising. But we need the same for sub-questions and answer texts as well. These also contain placeholders quite often. |
|
@adamzammit, any chance to look into this? |
|
@tibor.pacalat, what should we do with this half-baked solution? Maybe @DenisChenu can finish this task? |
|
Apologies @Mazi this fell off my radar. I will be able to spend some more time on this in the coming week. Can you confirm that the main use case you are looking at is ensuring the replacements happen at the "Print answers" stage (i.e on completion of the web survey). This should be more straightforward to implement in the first instance. |
|
@adamzammit, thanks for getting back. You are right, when enabling the "Print answers" feature at a survey, there is a "Export to queXML PDF" button. For that feature we also need to add replacing placeholders for subquestions and answers based on the current session data for this data set. |
|
@adamzammit, is there anything we can contribute to help implementing this? A customer will start a new project with placeholders soon and needs this fix. |
|
We could also manually backport a new fix to their system for further testing with their survey draft if this helps. |
|
I have updated the branch to support only processing EM when using the print answer function, and also supporting more replacement targets. Please let me know how you go with this patch: https://github.com/LimeSurvey/LimeSurvey/compare/master...adamzammit:LimeSurvey:fix-20114 Adam |
|
I locally installed https://github.com/adamzammit/LimeSurvey/tree/fix-20114 |
|
I executed the survey. |
|
Hi @bismark - I don't have any of the timeout errors that you are having. The form generation is very fast. Do you know how much memory is allocated to PHP? I am also able to generate both the regular queXML PDF export (attached as a ZIP file here) and also after completing the survey, the fields are processed as expected (see attached testumfrage-237912-queXML.pdf) |
|
@adamzammit, thanks for the feedback. Looks like something went wrong at our testing. @tibor.pacalat, can you doulbe check if needed so we can then add the fix to one of the next releases? |
|
Expression Manager can happen only for live survey, not for export ! I don't see a solution to replace {date("Y")} but not {if(Q00.NAOK,date("Y")} Then : you must test using "Print answers as QueXML" |
|
@DenisChenu, that totally makes sense! Does the fix work for you when calling the printable version at the end of the survey? |
|
No real time to test :) |
|
@tibor.pacalat, could you please provide a helping hand and double check if this works for you? I owe you some beers afterwards :-) |
|
I have tested this locally (added the changes from here https://github.com/adamzammit/LimeSurvey/commit/b45fda49134e47d881d722c625638dd942580274) and I still see the issue described in the ticket. In the screenshot: left - before fix, right - after fix. I have left all the questions unanswered, if this makes any difference or help with debugging. |
|
Thanks @tibor.pacalat. Beer is on my when I am visiting Hamburg next time :-) @adamzammit, any clue what we may be missing or doing wrong during testing? |
|
@adamzammit, it would be great if you can create a PR to Limesurvey with your proposed fix. |
|
Current :
Tested : Print answers as QueXML using survey_archive_589315.lsa Export as QueXML is OK : no replacement done. |
|
|
|
There is an issue with export quexmlPDF: B1 question text is empty In master or this comit. In export B1 question text must be |
|
Biggest issue
##Expected result## PDF show {Q00_QUES.shown} or "1st answer" for B1 question ##Actual result## PDF shown A new questoion, just answered not submitted for B1 question (usage of current). ##Potential solution## To have {Q00_QUES.shown} : just do not replace when export via admin Did I report this issue separatly ? |
|
@adamzammit, looks like we nearly got there. Only answers are not replaced yet, see https://bugs.limesurvey.org/view.php?id=20114#c83390. Can you double check? |
|
Date Modified | Username | Field | Change |
---|---|---|---|
2025-05-20 10:35 | Mazi | New Issue | |
2025-05-20 10:35 | Mazi | File Added: image.png | |
2025-05-20 10:35 | Mazi | File Added: limesurvey_survey_654535.lss | |
2025-05-20 10:36 | Mazi | Note Added: 82713 | |
2025-05-20 10:36 | Mazi | Bug heat | 6 => 8 |
2025-05-21 04:16 | adamzammit | Note Added: 82727 | |
2025-05-21 04:16 | adamzammit | Bug heat | 8 => 10 |
2025-05-21 10:01 | Mazi | Note Added: 82728 | |
2025-05-28 10:05 | tibor.pacalat | Assigned To | => adamzammit |
2025-05-28 10:05 | tibor.pacalat | Status | new => assigned |
2025-06-11 12:15 | Mazi | Note Added: 82863 | |
2025-06-12 05:19 | adamzammit | Note Added: 82866 | |
2025-06-12 09:29 | Mazi | Note Added: 82867 | |
2025-06-12 11:13 | DenisChenu | Note Added: 82868 | |
2025-06-12 11:13 | DenisChenu | Bug heat | 10 => 12 |
2025-06-12 11:13 | DenisChenu | Note Edited: 82868 | |
2025-06-13 09:47 | Mazi | View Status | private => public |
2025-06-13 09:47 | Mazi | Bug heat | 12 => 6 |
2025-06-18 07:00 | adamzammit | Note Added: 82893 | |
2025-06-18 10:10 | DenisChenu | Relationship added | related to 20139 |
2025-06-19 07:58 | adamzammit | Note Added: 82907 | |
2025-06-19 08:58 | DenisChenu | Note Added: 82908 | |
2025-06-24 05:07 | adamzammit | Note Added: 82935 | |
2025-06-24 08:20 | DenisChenu | Note Added: 82937 | |
2025-06-30 10:24 | Mazi | Note Added: 83012 | |
2025-07-03 15:24 | Mazi | Note Added: 83017 | |
2025-07-03 15:46 | DenisChenu | Note Added: 83018 | |
2025-07-03 15:46 | DenisChenu | File Added: 589315-4-queXML.pdf | |
2025-07-03 15:46 | DenisChenu | File Added: survey_archive_589315.lsa | |
2025-07-03 15:53 | Mazi | Note Added: 83019 | |
2025-07-03 16:00 | bismark | Note Added: 83020 | |
2025-07-03 16:00 | bismark | File Added: survey_archive_237912.lsa | |
2025-07-03 16:00 | bismark | File Added: 237912-1-queXML-2.pdf | |
2025-07-03 16:00 | bismark | Bug heat | 6 => 8 |
2025-07-03 16:07 | DenisChenu | Note Added: 83021 | |
2025-07-08 21:38 | Mazi | Note Added: 83043 | |
2025-07-20 05:59 | Mazi | Note Added: 83112 | |
2025-08-18 18:25 | Mazi | Note Added: 83240 | |
2025-08-19 05:01 | adamzammit | Note Added: 83241 | |
2025-08-19 10:20 | Mazi | Note Added: 83242 | |
2025-08-28 20:59 | Mazi | Note Added: 83338 | |
2025-08-28 21:00 | Mazi | Note Added: 83339 | |
2025-09-02 04:26 | adamzammit | Note Added: 83349 | |
2025-09-04 14:11 | bismark | Note Added: 83365 | |
2025-09-04 14:17 | bismark | Note Added: 83366 | |
2025-09-05 02:23 | adamzammit | Note Added: 83369 | |
2025-09-05 02:23 | adamzammit | File Added: testumfrage-237912-queXML.pdf | |
2025-09-05 02:23 | adamzammit | File Added: quexmlpdf_237912_de.zip | |
2025-09-05 10:13 | Mazi | Note Added: 83370 | |
2025-09-05 10:23 | DenisChenu | Note Added: 83371 | |
2025-09-05 11:26 | Mazi | Note Added: 83372 | |
2025-09-05 11:47 | DenisChenu | Note Added: 83373 | |
2025-09-06 19:29 | Mazi | Note Added: 83377 | |
2025-09-09 18:35 | tibor.pacalat | Note Added: 83385 | |
2025-09-09 18:35 | tibor.pacalat | File Added: Screenshot 2025-09-09 at 18.32.16.png | |
2025-09-09 18:35 | tibor.pacalat | Bug heat | 8 => 10 |
2025-09-09 20:22 | Mazi | Note Added: 83387 | |
2025-09-10 11:42 | tibor.pacalat | Note Added: 83389 | |
2025-09-10 11:58 | DenisChenu | Note Added: 83390 | |
2025-09-10 11:58 | DenisChenu | File Added: simple-quexcml-test-589315-queXML.pdf | |
2025-09-10 11:59 | DenisChenu | Note Added: 83391 | |
2025-09-10 11:59 | DenisChenu | File Added: Capture d’écran du 2025-09-10 11-58-54.png | |
2025-09-10 12:02 | DenisChenu | Note Added: 83392 | |
2025-09-10 12:02 | DenisChenu | File Added: quexmlpdf_589315_en.zip | |
2025-09-10 12:02 | DenisChenu | File Added: Capture d’écran du 2025-09-10 11-59-36.png | |
2025-09-10 12:10 | DenisChenu | Note Added: 83393 | |
2025-09-19 10:14 | Mazi | Note Added: 83449 |