View Issue Details

This bug affects 1 person(s).
 4
IDProjectCategoryView StatusLast Update
16580Bug reportsImport/Exportpublic2021-03-07 21:53
Reporterrudydehaas Assigned Toc_schmitz  
PrioritynoneSeveritypartial_block 
Status closedResolutionfixed 
Product Version4.2.8 
Fixed in Version4.4.7 
Summary16580: Data export fails on Writer.php line 316 -
Description

On export (both to csv file and to excel) I get a page of these:
Notice: Undefined index: interviewtime in /var/www/wadoorg/application/helpers/admin/export/Writer.php on line 316

Notice: Undefined index: 593955X10time in /var/www/wadoorg/application/helpers/admin/export/Writer.php on line 316

Notice: Undefined index: 593955X10X292time in /var/www/wadoorg/application/helpers/admin/export/Writer.php on line 316

Notice: Undefined index: 593955X10X297time in /var/www/wadoorg/application/helpers/admin/export/Writer.php on line 316

Followed by the stack trace and this php warning:
Cannot modify header information - headers already sent by (output started at /var/www/wadoorg/application/helpers/admin/export/Writer.php:316)

Steps To Reproduce

Notes:
1 - survey is live. I'll do a save/restore elsewhere later.

2 - How do I check which release is running? I have tar files for both 4.2.8 and 4.3.4.

Additional Information

/var/www/wadoorg/application/helpers/admin/export/ExcelWriter.php(59)

47 {
48 if (!$this->hasOutputHeader) {
49 $this->workbook->writeSheetRow($this->currentSheet, $headers);
50 $this->hasOutputHeader = true;
51 }
52 $this->workbook->writeSheetRow($this->currentSheet, $values);
53 }
54
55 public function close()
56 {
57 $this->workbook->writeToFile($this->filename);
58 if ($this->forceDownload) {
59 header("Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
60 header("Content-Disposition: attachment; filename=\"{$this->webfilename}.xlsx\"");
61 header('Content-Length: '.filesize($this->filename));
62 readfile($this->filename);
63 }
64 return $this->workbook;
65 }
66 }

Stack Trace
#0

/var/www/wadoorg/application/helpers/admin/export/ExcelWriter.php(59): header("Content-Type: application/vnd.openxmlformats-officedocument.spre...")

54
55 public function close()
56 {
57 $this->workbook->writeToFile($this->filename);
58 if ($this->forceDownload) {
59 header("Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
60 header("Content-Disposition: attachment; filename=\"{$this->webfilename}.xlsx\"");
61 header('Content-Length: '.filesize($this->filename));
62 readfile($this->filename);
63 }
64 return $this->workbook;

#1

/var/www/wadoorg/application/helpers/admin/exportresults_helper.php(107): ExcelWriter->close()

102 $survey = $surveyDao->loadSurveyById($iSurveyId, $sLanguageCode, $oOptions);
103 $writer->init($survey, $sLanguageCode, $oOptions);
104
105 $surveyDao->loadSurveyResults($survey, $oOptions->responseMinRecord, $oOptions->responseMaxRecord, $sFilter, $oOptions->responseCompletionState, $oOptions->selectedColumns, $oOptions->aResponses);
106 $writer->write($survey, $sLanguageCode, $oOptions, true);
107 $result = $writer->close();
108
109 // Close resultset if needed
110 if ($survey->responses instanceof CDbDataReader) {
111 $survey->responses->close();
112 }

#2

/var/www/wadoorg/application/controllers/admin/export.php(337): ExportSurveyResultsService->exportResponses("593955", "en", "xls", FormattingOptions, ...)

332 } else {
333 $sFilter = '';
334 }
335
336 viewHelper::disableHtmlLogging();
337 $resultsService->exportResponses($iSurveyID, $explang, $sExportType, $options, $sFilter);
338
339 Yii::app()->end();
340 }
341
342 /*

#3
unknown(0): export->exportresults()
#4
+
/var/www/wadoorg/framework/web/actions/CAction.php(109): ReflectionMethod->invokeArgs(export, array())
#5
+
/var/www/wadoorg/application/core/Survey_Common_Action.php(86): CAction->runWithParamsInternal(export, ReflectionMethod, array("surveyid" => "593955", "sa" => "exportresults", "iSurveyId" => "593955", "iSurveyID" => "593955", ...))
#6
+
/var/www/wadoorg/framework/web/CController.php(308): Survey_Common_Action->runWithParams(array("surveyid" => "593955", "sa" => "exportresults", "iSurveyId" => "593955", "iSurveyID" => "593955", ...))
#7
+
/var/www/wadoorg/framework/web/CController.php(286): CController->runAction(export)
#8
+
/var/www/wadoorg/framework/web/CController.php(265): CController->runActionWithFilters(export, array())
#9
+
/var/www/wadoorg/application/controllers/AdminController.php(180): CController->run("export")
#10
+
/var/www/wadoorg/framework/web/CWebApplication.php(282): AdminController->run("export")
#11
+
/var/www/wadoorg/framework/web/CWebApplication.php(141): CWebApplication->runController("admin/export/sa/exportresults")
#12

/var/www/wadoorg/framework/base/CApplication.php(185): CWebApplication->processRequest()

180 public function run()
181 {
182 if($this->hasEventHandler('onBeginRequest'))
183 $this->onBeginRequest(new CEvent($this));
184 register_shutdown_function(array($this,'end'),0,false);
185 $this->processRequest();
186 if($this->hasEventHandler('onEndRequest'))
187 $this->onEndRequest(new CEvent($this));
188 }
189
190 /**

#13
+
/var/www/wadoorg/index.php(182): CApplication->run()
2020-08-11 15:02:09 Apache/2.4.25 (Debian) Yii Framework/1.1.22-dev

TagsNo tags attached.
Bug heat4
Complete LimeSurvey version number (& build)limesurvey4.2.8+200608
I will donate to the project if issue is resolvedNo
Browser
Database type & versionServer version: 10.1.45-MariaDB-0+deb9u1 Debian 9.12
Server OS (if known)debian 9
Webserver software & version (if known)2020-08-11 15:02:09 Apache/2.4.25 (Debian) Yii Framework/1.1.22-dev
PHP Version7.3

Users monitoring this issue

There are no users monitoring this issue.

Activities

rudydehaas

rudydehaas

2020-08-11 17:23

reporter   ~59411

Changed export def to "Question code and Question text", expolrt to csv file, delimiter ";" and it does produce a file that looks like it has data in it. That file starts with six lines (I show 3 below, line 3 repeats 4 times):
<br />
<b>Notice</b>: Undefined index: interviewtime in <b>/var/www/wadoorg/application/helpers/admin/export/Writer.php</b> on line <b>316</b><br />
<br />
<b>Notice</b>: Undefined index: 593955X10time in <b>/var/www/wadoorg/application/helpers/admin/export/Writer.php</b> on line <b>316</b><br />
<br />
<b>Notice</b>: Undefined index: 593955X10X292time in <b>/var/www/wadoorg/application/helpers/admin/export/Writer.php</b> on line <b>316</b><br />
<br />

That same block appears between every line of data.

c_schmitz

c_schmitz

2021-03-07 21:17

administrator   ~62824

Hello rudydehaas,
This should already be fixed in recent versions.
Can you please check if this issue still exists in the latest version of LimeSurvey and let us know?
Thank you!

rudydehaas

rudydehaas

2021-03-07 21:42

reporter   ~62832

hiL
Just got your note.

I am now running 4.4.7+210215 . A quick test using data imported from a survey run using 4.3.24-201102 showed that print to csv and pdf work as expected. View stats and print to pdf works almost as expected: the pdf looked good and complete, but the onscreen display has a looping cube above the words "please wait, loading data..." that continued, apparently indefinitely, even after the report (PDF) is available in the download directory.

Note: I am running the latest Brave browser under debian 10, I have not tested this with firefox.

Thanks for looking at this!

c_schmitz

c_schmitz

2021-03-07 21:53

administrator   ~62836

Thank you for the feedback. Can you please open a separate bug report for the 'looping cube' issue? Thank you!

Issue History

Date Modified Username Field Change
2020-08-11 17:18 rudydehaas New Issue
2020-08-11 17:23 rudydehaas Note Added: 59411
2021-03-07 21:17 c_schmitz Assigned To => c_schmitz
2021-03-07 21:17 c_schmitz Status new => feedback
2021-03-07 21:17 c_schmitz Note Added: 62824
2021-03-07 21:42 rudydehaas Note Added: 62832
2021-03-07 21:42 rudydehaas Status feedback => assigned
2021-03-07 21:53 c_schmitz Note Added: 62836
2021-03-07 21:53 c_schmitz Status assigned => closed
2021-03-07 21:53 c_schmitz Resolution open => fixed
2021-03-07 21:53 c_schmitz Fixed in Version => 4.4.7