View Issue Details

This bug affects 1 person(s).
 6
IDProjectCategoryView StatusLast Update
13731Bug reportsImport/Exportpublic2018-06-15 14:27
ReporterJuliaP Assigned ToDenisChenu  
PrioritynoneSeverityminor 
Status closedResolutionfixed 
Product Version3.0.x 
Fixed in Version3.8.x 
Summary13731: SPSS export does not recognise line breaks in open comments
Description

When exporting survey responses to an SPSS command file (to SPSS 25), line breaks are ignored in long free text comments. This results in e.g. the comment:
"at work
at home"
being displayed as "at workat home" in SPSS and all subsequently used analysis tools. The error occurs in version 2.67.3. Using version 2.73.1. and 3.8.2. did not solve the issue.

TagsNo tags attached.
Bug heat6
Complete LimeSurvey version number (& build)Version 2.67.3+170728
I will donate to the project if issue is resolvedNo
Browser
Database type & versionnot known
Server OS (if known) not known
Webserver software & version (if known) not known
PHP Version not known

Users monitoring this issue

There are no users monitoring this issue.

Activities

DenisChenu

DenisChenu

2018-06-02 14:06

developer   ~47945

Last edited: 2018-06-02 14:07

Action is done here : https://github.com/LimeSurvey/LimeSurvey/blob/ca844d498966355614ac446b48306b0df34d2f8c/application/helpers/export_helper.php#L215

Can you test replacing with fir the 2 part ?
$strTemp = str_replace(array("'"), array("''"), trim($strTmp));

Tottaly unsure of SPSS compatibility with such fixes, and maybe related to SPSS version …

Mazi

Mazi

2018-06-05 12:37

updater   ~47987

@DenisChenu, did I get you right that I should adjust the code this way by adjusting the second IF(...) with the adjusted str_replace(...) details?
$strTmp = mb_substr(stripTagsFull($row[$fieldno]), 0, $iLength);
if (trim($strTmp) != '') {
if ($q == '\'') {
//$strTemp = str_replace(array("'", "\n", "\r"), array("''", ' ', ' '), trim($strTmp));
$strTemp = str_replace(array("'"), array("''"), trim($strTmp));
}
if ($q == '"') {
$strTemp = str_replace(array('"', "\n", "\r"), array('""', ' ', ' '), trim($strTmp));
}

DenisChenu

DenisChenu

2018-06-06 09:13

developer   ~47997

We can't export line feed ias line feed in SPSS because SPSS don't understand line feed. But seems export remove line feed and don't replace it by a space.

DenisChenu

DenisChenu

2018-06-06 09:26

developer   ~47998

Replacing line feed by white space.

c_schmitz

c_schmitz

2018-06-15 14:27

administrator   ~48130

New version released.

Related Changesets

LimeSurvey: master 3283f3ea

2018-06-06 09:24:41

DenisChenu

Details Diff
Fixed issue : line feed stripped and not replaced in SPSS export
Dev: flattenText remove whole
Affected Issues
13731
mod - application/helpers/export_helper.php Diff File

Issue History

Date Modified Username Field Change
2018-06-01 15:06 JuliaP New Issue
2018-06-02 14:06 DenisChenu Note Added: 47945
2018-06-02 14:07 DenisChenu Note Edited: 47945
2018-06-05 12:37 Mazi Note Added: 47987
2018-06-06 09:13 DenisChenu Note Added: 47997
2018-06-06 09:25 DenisChenu Changeset attached => LimeSurvey master 3283f3ea
2018-06-06 09:26 DenisChenu Assigned To => DenisChenu
2018-06-06 09:26 DenisChenu Status new => closed
2018-06-06 09:26 DenisChenu Resolution open => fixed
2018-06-06 09:26 DenisChenu Fixed in Version => 3.8.x
2018-06-06 09:26 DenisChenu Note Added: 47998
2018-06-06 09:27 DenisChenu Status closed => resolved
2018-06-06 09:27 DenisChenu Product Version => 3.0.x
2018-06-15 14:27 c_schmitz Note Added: 48130
2018-06-15 14:27 c_schmitz Status resolved => closed