View Issue Details

This bug affects 1 person(s).
 10
IDProjectCategoryView StatusLast Update
17883Bug reportsImport/Exportpublic2022-11-07 13:59
Reporter2BITS_PL Assigned Toadamzammit  
PrioritynoneSeverityminor 
Status assignedResolutionfixed 
Product Version3.25.19 
Summary17883: QueXML formatting cannot be changed
Description

There is a hard-defined variable "style" in the quexmlpdf.php file.

If from the survey I go to menu Survey setting: Overview > Display/Export (button) > queXML PDF - path: "admin/export/sa/quexml/surveyid/xxxxxx".
Above style is loaded, I can modify it before exporting. The problem is that my configuration isn't saved anywhere. When I go back to exporting, it doesn't see my previous changes.

The second view inside the survey edition, go to the Survey menu: Responses. In the list, in one line, I click the "View response details as queXML PDF" icon. Tutja can't change style, it loads default from quexmlpdf.php.

The second view inside the survey edition, go to the Survey menu: Responses. In the list, in one line, I click the "View response details as queXML PDF" icon. Tutja can't change style, it loads default from quexmlpdf.php. I looked at https://demo.limesurvey.org/ and I see the same problem there.

Steps To Reproduce

Steps to reproduce

(Replace this text with detailed step-by-step instructions on how to reproduce the issue)

Expected result

(Write here what you expected to happen)

Actual result

(Write here what happened instead)

TagsNo tags attached.
Bug heat10
Complete LimeSurvey version number (& build)v3.25.19+210323
I will donate to the project if issue is resolvedNo
Browser
Database type & versionSQL Server 2019
Server OS (if known)Microsoft Server 2019
Webserver software & version (if known)
PHP Versionv7.4.15 NTS x64

Users monitoring this issue

User List 2BITS_PL

Activities

adamzammit

adamzammit

2022-02-11 04:16

developer   ~68266

I can confirm that the "Style" portion is currently not saved. I think originally this was due to XML content not playing nicely with the SaveSettings function.

I can also confirm that when using "View response details as queXML PDF", the export appears as default.

I'll work up a pull request soon that addresses these issues.

adamzammit

adamzammit

2022-02-15 06:01

developer   ~68294

I've worked up a patch here:

https://github.com/LimeSurvey/LimeSurvey/compare/3.x-LTS...adamzammit:fix-17883.diff

Can you please give it a go and see if it works for you and then I will submit it to be included in the next LTS release.

Thanks

2BITS_PL

2BITS_PL

2022-02-22 12:04

reporter   ~68349

I checked, the configuration is saved in the database and it works globally, but only on the administration panel side. I haven't tested XSS and SQL Injection.

Not working, in the participant results print page, after completing the survey, below is a fix that worked here. But I don't know if that's all.

fixedPrintanswerController.diff (974 bytes)   
 application/controllers/PrintanswersController.php | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/application/controllers/PrintanswersController.php b/application/controllers/PrintanswersController.php
index 36d10148..c502c0a4 100644
--- a/application/controllers/PrintanswersController.php
+++ b/application/controllers/PrintanswersController.php
@@ -190,6 +190,15 @@ class PrintanswersController extends LSYii_Controller
 
             $quexmlpdf = new quexmlpdf();
 
+            //apply settings stored at last output
+            foreach ($quexmlpdf->_quexmlsettings() as $s) {
+                $setting = getGlobalSetting($s);
+                if ($setting !== null && trim($setting) !== '') {
+                    $method = str_replace("queXML", "set", $s);
+                    $quexmlpdf->$method($setting);
+                }
+            }
+
             // Setting the selected language for printout
             App()->setLanguage($sLanguage);
 
2BITS_PL

2BITS_PL

2022-08-04 09:24

reporter   ~71318

Will it be corrected and implemented and when?

adamzammit

adamzammit

2022-08-05 03:24

developer   ~71345

My apologies for this - it had fallen off my radar. Thank you for reminding me.

I've applied your patch and submitted a pull request here: https://github.com/LimeSurvey/LimeSurvey/pull/2561

gabrieljenik

gabrieljenik

2022-10-04 14:21

manager   ~72071

Code looks OK.
Master PR is pending. Maybe we can make the settings screen a screen of its own?

adamzammit

adamzammit

2022-10-24 00:23

developer   ~72381

thanks @gabrieljenik .

I'm happy to work on a settings screen that is separate - maybe we could start a new bug/feature request for that and assign it to me? That could allow this PR to solve the current issue.

Adam

gabrieljenik

gabrieljenik

2022-10-24 15:44

manager   ~72390

I guess best is to involve @c_schmitz into that decision :)

adamzammit

adamzammit

2022-11-02 11:23

developer   ~72510

Fix committed to 3.x-LTS branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=34014

LimeBot

LimeBot

2022-11-07 11:36

administrator   ~72587

Fixed in Release 3.28.37+221108

gabrieljenik

gabrieljenik

2022-11-07 13:59

manager   ~72606

Adam would you please prepare a prt for master as well as to have LTs and master at the same level?

Related Changesets

LimeSurvey: 3.x-LTS 5f7a35a2

2022-11-02 11:12:10

adamzammit


Committer: GitHub Details Diff
Fixed issue 17883: QueXML formatting cannot be changed (#2561)

Dev: Patch by 2BITS_PL
Affected Issues
17883
mod - application/controllers/PrintanswersController.php Diff File
mod - application/controllers/admin/export.php Diff File
mod - application/controllers/admin/responses.php Diff File
mod - application/libraries/admin/quexmlpdf.php Diff File
mod - application/views/admin/survey/queXMLSurvey_view.php Diff File

Issue History

Date Modified Username Field Change
2022-02-10 14:14 2BITS_PL New Issue
2022-02-10 14:25 2BITS_PL Issue Monitored: 2BITS_PL
2022-02-10 14:25 2BITS_PL Bug heat 0 => 2
2022-02-11 04:14 adamzammit Assigned To => adamzammit
2022-02-11 04:14 adamzammit Status new => assigned
2022-02-11 04:16 adamzammit Status assigned => confirmed
2022-02-11 04:16 adamzammit Note Added: 68266
2022-02-11 04:16 adamzammit Bug heat 2 => 4
2022-02-15 06:01 adamzammit Note Added: 68294
2022-02-22 12:04 2BITS_PL Note Added: 68349
2022-02-22 12:04 2BITS_PL File Added: fixedPrintanswerController.diff
2022-02-22 12:04 2BITS_PL Bug heat 4 => 6
2022-08-04 09:24 2BITS_PL Note Added: 71318
2022-08-05 03:24 adamzammit Note Added: 71345
2022-10-04 14:21 gabrieljenik Status confirmed => ready for testing
2022-10-04 14:21 gabrieljenik Note Added: 72071
2022-10-04 14:21 gabrieljenik Bug heat 6 => 8
2022-10-21 14:43 gabrieljenik Assigned To adamzammit => ollehar
2022-10-21 14:43 gabrieljenik Status ready for testing => ready for merge
2022-10-24 00:23 adamzammit Note Added: 72381
2022-10-24 15:44 gabrieljenik Note Added: 72390
2022-11-02 11:23 adamzammit Changeset attached => LimeSurvey 3.x-LTS 5f7a35a2
2022-11-02 11:23 adamzammit Note Added: 72510
2022-11-02 11:23 adamzammit Assigned To ollehar => adamzammit
2022-11-02 11:23 adamzammit Resolution open => fixed
2022-11-07 11:36 LimeBot Note Added: 72587
2022-11-07 11:36 LimeBot Status ready for merge => closed
2022-11-07 11:36 LimeBot Bug heat 8 => 10
2022-11-07 13:59 gabrieljenik Status closed => assigned
2022-11-07 13:59 gabrieljenik Note Added: 72606