Skip to content

Commit

Permalink
Fixed issue #17509: when exporting/importing surveys as "Tab-separate…
Browse files Browse the repository at this point in the history
…d-values" encryption settings are lost
  • Loading branch information
ptelu committed Sep 10, 2021
1 parent 97454bd commit 4084f25
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions application/helpers/admin/import_helper.php
Expand Up @@ -2860,6 +2860,7 @@ function TSVImportSurvey($sFullFilePath)
$question['help'] = (isset($row['help']) ? $row['help'] : '');
$question['language'] = (isset($row['language']) ? $row['language'] : $baselang);
$question['mandatory'] = (isset($row['mandatory']) ? $row['mandatory'] : '');
$question['encrypted'] = (isset($row['encrypted']) ? $row['encrypted'] : 'N');
$lastother = $question['other'] = (isset($row['other']) ? $row['other'] : 'N'); // Keep trace of other settings for sub question
$question['same_default'] = (isset($row['same_default']) ? $row['same_default'] : 0);
$question['parent_qid'] = 0;
Expand Down
3 changes: 3 additions & 0 deletions application/helpers/export_helper.php
Expand Up @@ -2523,6 +2523,7 @@ function tsvSurveyExport($surveyid)
'language',
'validation',
'mandatory',
'encrypted',
'other',
'default',
'same_default',
Expand Down Expand Up @@ -2838,6 +2839,7 @@ function tsvSurveyExport($surveyid)
$tsv_output['help'] = !empty($question['help']) ? str_replace(array("\n", "\r"), '', $question['help']) : '';
$tsv_output['language'] = $question['language'];
$tsv_output['mandatory'] = !empty($question['mandatory']) ? $question['mandatory'] : '';
$tsv_output['encrypted'] = !empty($question['encrypted']) ? $question['encrypted'] : 'N';
$tsv_output['other'] = $question['other'];
$tsv_output['same_default'] = $question['same_default'];

Expand All @@ -2861,6 +2863,7 @@ function tsvSurveyExport($surveyid)
}
fputcsv($out, array_map('MaskFormula', $tsv_output), chr(9));


// quota members
if ($index_languages == 0 && !empty($quota_members[$qid])) {
foreach ($quota_members[$qid] as $key => $member) {
Expand Down

0 comments on commit 4084f25

Please sign in to comment.