View Issue Details

IDProjectCategoryView StatusLast Update
16580Bug reportsImport/Exportpublic2020-08-11 17:23
Reporterrudydehaas Assigned To 
PrioritynoneSeveritypartial_block 
Status newResolutionopen 
Product Version4.2.8 
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.
Complete LimeSurvey version number (& build)limesurvey4.2.8+200608
I will donate to the project if issue is resolvedNo
Browser
Database & DB-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

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.

Issue History

Date Modified Username Field Change
2020-08-11 17:18 rudydehaas New Issue
2020-08-11 17:23 rudydehaas Note Added: 59411