TypeError

Cannot access offset of type string on string

/var/www/html/lime_app/limesurvey_230116/application/core/plugins/ExportSTATAxml/STATAxmlWriter.php(404)

392                                 '1',
393                                 '0',
394                                 '-1'
395                             ), $response);
396                             break;
397                         case Question::QT_D_DATE: //replace in customResponsemap: date/time as string with STATA-timestamp
398                             $response = strtotime($response . ' GMT') * 1000 + 315619200000; // convert seconds since 1970 (UNIX) to milliseconds since 1960 (STATA)
399                             break;
400                         case Question::QT_L_LIST:
401                             // For radio lists, user wants code, not label
402                             // TODO: We could skip this loop if we had answer code
403                             foreach ($this->customFieldmap['answers'][$iQID][$iScaleID] as $answer) {
404                                 if ($answer['answer'] == $response) {
405                                     $response = $answer['code'];
406                                     break;
407                                 }
408                             }
409                             break;
410                     }
411 
412                     /* look at each of the responses and determine STATA data type and format of the respective variables
413                        datatypes coded as follows:
414                        1=""
415                        2=byte
416                        3=int

Stack Trace

#0
+
 /var/www/html/lime_app/limesurvey_230116/application/core/plugins/ExportSTATAxml/STATAxmlWriter.php(528): STATAxmlWriter->updateCustomresponsemap()
523      * - value labels
524      */
525     public function close()
526     {
527 
528         $this->updateCustomresponsemap();
529 
530         $xml = new XMLWriter();
531         $xml->openMemory();
532         $xml->setIndent(true);
533 
#1
+
 /var/www/html/lime_app/limesurvey_230116/application/helpers/admin/exportresults_helper.php(121): STATAxmlWriter->close()
116             $responsesQuery->offset($offset);
117             $responsesQuery->limit($maxRows);
118             $survey->responses = $responsesQuery->query();
119             $writer->write($survey, $sLanguageCode, $oOptions, true);
120         }
121         $result = $writer->close();
122 
123         // Close resultset if needed
124         if ($survey->responses instanceof CDbDataReader) {
125             $survey->responses->close();
126         }
#2
+
 /var/www/html/lime_app/limesurvey_230116/application/controllers/admin/Export.php(352): ExportSurveyResultsService->exportResponses()
347         } else {
348             $sFilter = '';
349         }
350 
351         viewHelper::disableHtmlLogging();
352         $resultsService->exportResponses($iSurveyID, $explang, $sExportType, $options, $sFilter);
353 
354         Yii::app()->end();
355     }
356 
357     /**
2023-01-23 08:49:35 nginx/1.22.1 Yii Framework/1.1.26