View Issue Details

IDProjectCategoryView StatusLast Update
12713Bug reports[All Projects] Import/Exportpublic2017-12-16 10:29
ReporterFl_DutchmanAssigned ToDenisChenu 
PrioritynoneSeveritymajor 
Status closedResolutionunable to reproduce 
Product Version2.55.x 
Target VersionFixed in Version 
Summary12713: Undefined offset: 1 in SPSS export function
DescriptionIf I want to export the Responses of one of my surveys to SPSS, I get an error when trying to export the syntax file. The first ~100 lines are OK and then some HTML code is added to the *.sps file. It seems to be an PHP Stack Trace.
Steps To Reproduce- Create a survey
- open the survey
- Responses => Responses & statistics
- Export => Export results to a SPSS/PASW command file
- leave everything on default
- click Export syntax

-> download starts and finishes without error but then there is a php error in the file
Additional InformationI know I use an older version of limesurvey, but the code of the export.php (in which the error occurs) isn't changed since this version.

Since this error only occurs in one of our surveys, it is probably hard to reproduce. But I think the strack trace is quite helpful.
I took a look at the stack trace and it shows an Undefined offset of an array. After taking a closer look on the code, it seemed to me that there is a little mistake in the code:
- you iterate over every element of $label_parts
- you stop at the last element of the array $label_parts
- but you always access the current element and the next element
- at the last element you cannot access the next element => Array out of bound exception or in php language: Undefined offset:1

I solved it for now with a dirty workaround by checking if the "$idx+1"th element exists and only then it tries to access it. But I guess it doesn't solve the problem. I guess a better variant is to create a new array with "count($label_parts) + 1" elements and add the quotes. But since I don't really understand what code block exactly does, I cannot tell for sure.

Of course feel free to ask for additional info.


Regards,

Kelvin
Tagserror!, export, spss
Complete LimeSurvey version number (& build)2.55.1+161026
I will donate to the project if issue is resolvedNo
BrowserChrome
Database & DB-VersionMySQL 5.5.53-0ubuntu0.14.04.1
Operating System (Server)Ubuntu 14.04.5 LTS
Webserver software & versionApache 2.4.7-1ubuntu4.13
PHP Version5.5.9-1ubuntu4.20

Activities

Fl_Dutchman

Fl_Dutchman

2017-09-26 14:30

reporter  

limesurvey_error.html (17,860 bytes)
DenisChenu

DenisChenu

2017-10-13 13:45

developer   ~44657

Can you test after updating application/controllers/admin/export.php and application/helpers/export_helper.php with the 2 file in https://github.com/LimeSurvey/LimeSurvey/pull/815/files

If it's fix the issue : tell me, if not : you can send the lsa file here (in private mode if needed).
DenisChenu

DenisChenu

2017-10-17 10:09

developer   ~44703

Please : send a LSA file to reproduce the issue
DenisChenu

DenisChenu

2017-12-11 15:49

developer   ~45274

@Fl_Dutchman : if i don't have a LSA file to reproduce and fix, i can not fix it …
DenisChenu

DenisChenu

2017-12-16 10:29

developer   ~45313

I need to know when this happen exactly, why it's happen … before make a really fix :)

Issue History

Date Modified Username Field Change
2017-09-26 14:30 Fl_Dutchman New Issue
2017-09-26 14:30 Fl_Dutchman File Added: limesurvey_error.html
2017-10-04 13:54 Fl_Dutchman Tag Attached: error!
2017-10-04 13:54 Fl_Dutchman Tag Attached: export
2017-10-04 13:54 Fl_Dutchman Tag Attached: spss
2017-10-13 13:45 DenisChenu Note Added: 44657
2017-10-13 14:04 DenisChenu Assigned To => DenisChenu
2017-10-13 14:04 DenisChenu Status new => assigned
2017-10-17 10:09 DenisChenu Status assigned => feedback
2017-10-17 10:09 DenisChenu Note Added: 44703
2017-12-11 15:49 DenisChenu Note Added: 45274
2017-12-16 10:29 DenisChenu Status feedback => closed
2017-12-16 10:29 DenisChenu Resolution open => unable to reproduce
2017-12-16 10:29 DenisChenu Note Added: 45313