View Issue Details

This bug affects 1 person(s).
 6
IDProjectCategoryView StatusLast Update
16694Bug reportsImport/Exportpublic2020-10-12 09:28
ReporterSelcal Assigned Togabrieljenik  
PrioritynoneSeveritypartial_block 
Status closedResolutionfixed 
Product Version4.3.17 
Summary16694: Export multiple surveys (lss, lsa) to ZIP crashes or does not export reports/tokens for correct survey
Description

If exporting multiple surveys to ZIP, the export_helper.php does not reference the correct survey in function buildXMLFromQuery

If logging in, and going straight to Surveys -> select multiple -> export as lss/lsa, an exception may occur if session['LEMsid'] is set to a survey that does not match the export type.
If it does contain a survey matching the type (lsa, containing tokens/responses), it shows success but actually exports the wrong tokens and responses to the lsa files. The result is an export where all exported survey .lsa files actually contain the same (not matching) tokens and responses.

Occurs (tested) also on 4.3.3.

Steps To Reproduce

Surveys -> Multi-select -> export to zip archive (lsa)
If exception does not occur, import the downloaded lsa files back into a limesurvey installation.
You will find that the response/token lists do not match the exported surveys, and are the same for all ex/imported surveys.

Additional Information

By setting the $session['LEMsid'] temporarily,and setting it back after each export in function _exportarchive, I have worked around this and had correct functionality:
Obviously this is a dirty fix but I am not conversant with limesurvey's core structure so not in a position to attempt a neat fix.

Change application/controllers/admin/export.php at line 976:

After:
private function _exportarchive($iSurveyID, $bSendToBrowser = true)
{
Add:
$temp = $_SESSION['LEMsid'];
$_SESSION['LEMsid'] = $iSurveyID;

After:
} else {
return($aZIPFileName);
}
}
Add:
$_SESSION['LEMsid'] = $temp;

TagsNo tags attached.
Bug heat6
Complete LimeSurvey version number (& build)4.3.17+200921
I will donate to the project if issue is resolvedNo
Browser
Database type & versionMySQL
Server OS (if known)
Webserver software & version (if known)
PHP Version7.2

Users monitoring this issue

There are no users monitoring this issue.

Activities

gabrieljenik

gabrieljenik

2020-10-01 14:42

manager   ~60022

https://github.com/LimeSurvey/LimeSurvey/pull/1610

In 'buildXMLFromQuery', the survey ID is needed for response and token decryption.
It was being derived from session. which worked when exporting a single survey info, or from within a survey. Now an optional parameter was added so the ID can be specified by the caller.

gabrieljenik

gabrieljenik

2020-10-01 14:42

manager   ~60023

This could be happening as well on Lsv3

Selcal

Selcal

2020-10-01 20:56

reporter   ~60041

I found this bug when migrating several v3.22.25 and v4.x.x installations.
Multi-exporting on V3.22.25 did not exhibit the same issue for me and exporting went without issue.

gabrieljenik

gabrieljenik

2020-10-08 22:31

manager   ~60128

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=30560

lime_release_bot

lime_release_bot

2020-10-12 09:28

administrator   ~60147

Fixed in Release 4.3.20+201012

Related Changesets

LimeSurvey: master 88a9a285

2020-10-01 14:41:10

gabrieljenik


Committer: user234287 Details Diff
Fixed issue 16694: Export multiple surveys (lss, lsa) to ZIP crashes or does not export reports/tokens for correct survey

In 'buildXMLFromQuery', the survey ID is needed for response and token decryption.
It was being derived from session. which worked when exporting a single survey info, or from within a survey. Now an optional parameter was added so the ID can be specified by the caller.
Affected Issues
16694
mod - application/helpers/export_helper.php Diff File

Issue History

Date Modified Username Field Change
2020-09-24 20:21 Selcal New Issue
2020-09-25 15:05 cdorin Assigned To => gabrieljenik
2020-09-25 15:05 cdorin Status new => assigned
2020-10-01 14:42 gabrieljenik Note Added: 60022
2020-10-01 14:42 gabrieljenik Note Added: 60023
2020-10-01 20:56 Selcal Note Added: 60041
2020-10-08 22:31 user234287 Changeset attached => LimeSurvey master 88a9a285
2020-10-08 22:31 gabrieljenik Note Added: 60128
2020-10-08 22:31 gabrieljenik Resolution open => fixed
2020-10-12 09:28 lime_release_bot Note Added: 60147
2020-10-12 09:28 lime_release_bot Status assigned => closed