View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
19049 | Bug reports | Import/Export | public | 2023-08-25 02:55 | 2024-02-06 17:38 |
Reporter | adamzammit | Assigned To | tibor.pacalat | ||
Priority | none | Severity | minor | ||
Status | closed | Resolution | fixed | ||
Product Version | 6.2.x | ||||
Summary | 19049: Cannot export LSS from survey where theme is set to one extended from 'bootswatch' | ||||
Description | Trying to export to LSS from a survey with a theme extended from bootswatch causes a 500 error. Error occurs here: https://github.com/LimeSurvey/LimeSurvey/blob/f62e9142e45b665796eec774a9368517161121f4/application/helpers/export_helper.php#L3138 Caused by this: https://github.com/LimeSurvey/LimeSurvey/blob/f62e9142e45b665796eec774a9368517161121f4/application/models/TemplateConfiguration.php#L318 that returns an array with objects in it "@attribute"->"cssframework" . This breaks simplexml as it is expecting an array | ||||
Steps To Reproduce | Steps to reproduceCreate a theme by extending the bootswatch theme Expected resultDownload LSS File Actual result500 error | ||||
Tags | No tags attached. | ||||
Attached Files | |||||
Bug heat | 22 | ||||
Complete LimeSurvey version number (& build) | 6.2.4 | ||||
I will donate to the project if issue is resolved | No | ||||
Browser | |||||
Database type & version | Mariadb 10.5 | ||||
Server OS (if known) | |||||
Webserver software & version (if known) | |||||
PHP Version | 8.1 | ||||
related to | 18895 | closed | tibor.pacalat | No way to add textarea with core config.xml |
This is very complicated, but we have a fix. |
|
Master: https://github.com/LimeSurvey/LimeSurvey/pull/3521 The patch is only for the source of the problem, which is when a theme is extended. The problem happened when loading the config.xml. When there is a default value:
This is transformed to PHP (and then JSON), as
When there is NO default value:
This is transformed to PHP (and then JSON), as
So, when there is no default value, the internal nodes (dropdownoptions) are intended to be included into the LSS. Summing up:
This should also happen on Fruity, as it doesn't have a default value. Would love to listen to your thoughts before approaching the update routine. Thanks |
|
Thanks @gabrieljenik for debugging this. If the "Default value" was stored in a tag or as an attribute, could the XML traversal be normalised? |
|
Maybe Adam can review code ? |
|
Actually, when storing as json on DB, LS code doesn't expect more nodes under an options node. So I would store it as a an attribute. |
|
This part must be fixed too : we must use only valid XML, no ? |
|
I am facing a very similar issue. Exporting a survey using "fruity" theme works fine. If I then assign "extend_fruity" child theme, the export fails. -> Is this the same issue? Since at the issue description only Bootstrap is mentioned. |
|
Could be. I found stuff in the config.xml that resembles the conditions for this bug |
|
@gabrieljenik how can I reproduce this issue? |
|
Seems @olle added a default value for the variation option on the Bootswatch config.xml on 19232 https://github.com/LimeSurvey/LimeSurvey/commit/eb27f86043718396dd71bcbde31b898683114615 . That made the problem to be hidden. |
|
I can export surveys that use extended bootswatch and fruity themes. |
|
Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=35781 |
|
Fixed in Release 6.3.8+231204 |
|
This bug seems to still affect version 6.4.5+240205 |
|
@bquiller I have just tested this using these steps:
and I managed to successfully download the lss file using LS version 6.4.5+240205. Can you give me more details about your environment (browser, database ... ) and steps on how I could reproduce what you are seeing? |
|
LimeSurvey: master 10ba9048 2023-11-27 15:02 Gabriel Jenik Committer: GitHub Details Diff |
Fixed issue 19049: Cannot export LSS from survey where theme is set to one extended from 'bootswatch' (03521) |
Affected Issues 19049 |
|
mod - application/models/TemplateConfig.php | Diff File | ||
mod - application/models/TemplateManifest.php | Diff File | ||
add - tests/unit/models/TemplateConfigTest.php | Diff File |
Date Modified | Username | Field | Change |
---|---|---|---|
2023-08-25 02:55 | adamzammit | New Issue | |
2023-08-25 02:55 | adamzammit | File Added: limesurvey-error-export-after-template-2023-08-25_09.45.20.m4v | |
2023-09-14 14:18 | gabrieljenik | Assigned To | => gabrieljenik |
2023-09-14 14:18 | gabrieljenik | Status | new => assigned |
2023-10-06 21:56 | gabrieljenik | Note Added: 77551 | |
2023-10-06 21:56 | gabrieljenik | Bug heat | 0 => 2 |
2023-10-09 21:04 | gabrieljenik | Note Added: 77593 | |
2023-10-09 21:05 | gabrieljenik | Note Edited: 77593 | |
2023-10-09 21:06 | gabrieljenik | Note Edited: 77593 | |
2023-10-09 21:09 | gabrieljenik | Note Edited: 77593 | |
2023-10-09 21:17 | gabrieljenik | Note Edited: 77593 | |
2023-10-09 23:57 | adamzammit | Note Added: 77597 | |
2023-10-09 23:57 | adamzammit | Bug heat | 2 => 4 |
2023-10-10 10:50 | DenisChenu | Note Added: 77599 | |
2023-10-10 10:50 | DenisChenu | Bug heat | 4 => 6 |
2023-10-10 14:41 | gabrieljenik | Note Added: 77610 | |
2023-11-02 12:19 | DenisChenu | Relationship added | related to 18895 |
2023-11-13 08:51 | DenisChenu | Note Added: 78399 | |
2023-11-22 12:58 | gabrieljenik | Assigned To | gabrieljenik => DenisChenu |
2023-11-22 12:58 | gabrieljenik | Status | assigned => ready for code review |
2023-11-22 16:04 | DenisChenu | Assigned To | DenisChenu => tibor.pacalat |
2023-11-22 16:04 | DenisChenu | Status | ready for code review => ready for testing |
2023-11-23 14:19 | Mazi | Note Added: 78678 | |
2023-11-23 14:19 | Mazi | Bug heat | 6 => 14 |
2023-11-23 14:27 | gabrieljenik | Note Added: 78680 | |
2023-11-23 16:33 | tibor.pacalat | Note Added: 78688 | |
2023-11-23 16:33 | tibor.pacalat | Bug heat | 14 => 16 |
2023-11-24 16:48 | gabrieljenik | Note Added: 78710 | |
2023-11-27 14:01 | tibor.pacalat | Note Added: 78732 | |
2023-11-27 14:02 | Changeset attached | => LimeSurvey master 10ba9048 | |
2023-11-27 14:02 | guest | Note Added: 78733 | |
2023-11-27 14:02 | guest | Bug heat | 16 => 18 |
2023-11-27 17:25 | tibor.pacalat | Status | ready for testing => resolved |
2023-11-27 17:25 | tibor.pacalat | Resolution | open => fixed |
2023-12-04 12:58 | LimeBot | Note Added: 78862 | |
2023-12-04 12:58 | LimeBot | Status | resolved => closed |
2023-12-04 12:58 | LimeBot | Bug heat | 18 => 20 |
2024-02-06 09:56 | bquiller | Note Added: 79423 | |
2024-02-06 09:56 | bquiller | Bug heat | 20 => 22 |
2024-02-06 17:38 | tibor.pacalat | Note Added: 79427 |