PHP notice

Undefined offset: 1

/data/webdev/3LTS/application/helpers/admin/import_helper.php(1977)

1965             if ($aOptions['bNotFinalized']) {
1966                 $oSurvey->submitdate = new CDbExpression('NULL');
1967             } elseif (is_int($iSubmitdateKey)) {
1968                 if ($aResponses[$iSubmitdateKey] == '{question_not_shown}' || trim($aResponses[$iSubmitdateKey] == '')) {
1969                     $oSurvey->submitdate = new CDbExpression('NULL');
1970                 } else {
1971                     // Maybe control valid date : see http://php.net/manual/en/function.checkdate.php#78362 for example
1972                     $oSurvey->submitdate = $aResponses[$iSubmitdateKey];
1973                 }
1974             }
1975 
1976             foreach ($aKeyForFieldNames as $sFieldName=>$iFieldKey) {
1977                 if ($aResponses[$iFieldKey] == '{question_not_shown}') {
1978                     $oSurvey->$sFieldName = new CDbExpression('NULL');
1979                 } else {
1980                     $sResponse = str_replace(array("{quote}", "{tab}", "{cr}", "{newline}", "{lbrace}"), array("\"", "\t", "\r", "\n", "{"), $aResponses[$iFieldKey]);
1981                     $oSurvey->$sFieldName = $sResponse;
1982                 }
1983             }
1984 
1985             //Check if datestamp is set => throws no default error on importing
1986             if($oSurvey->hasAttribute('datestamp') && !isset($oSurvey->datestamp)){
1987                 $oSurvey->datestamp = '1980-01-01 00:00:01';
1988             } 
1989             //Check if startdate is set => throws no default error on importing

Stack Trace

#0
+
 /data/webdev/3LTS/application/controllers/admin/dataentry.php(146): CSVImportResponses("/data/webdev/3LTS/tmp/wsk4tn5fcf4mngcpxwv7", "629533", array("bDeleteFistLine" => true, "sExistingId" => "ignore", "bNotFinalized" => false, "bForceImport" => false, ...))
141         }
142         $aOptions['bNotFinalized'] = (bool) Yii::app()->request->getPost('notfinalized');
143         $aOptions['bForceImport'] = (bool) Yii::app()->request->getPost('forceimport');
144         $aOptions['sCharset'] = Yii::app()->request->getPost('vvcharset');
145         $aOptions['sSeparator'] = "\t";
146         $aResult = CSVImportResponses($filePath, $iSurveyId, $aOptions);
147         unlink($filePath); //delete the uploaded file
148         $aData['class'] = "";
149         $aData['title'] = gT("Import a VV response data file");
150         $aData['aResult']['success'][] = gT("File upload succeeded.");
151         if (isset($aResult['success'])) {
#1
+
 /data/webdev/3LTS/application/controllers/admin/dataentry.php(96): dataentry->_handleFileUpload("629533", array("display" => array("menu_bars" => array("browse" => "Saisie de données")), "title_bar" => array("title" => "Saisie de données"), "sidemenu" => array("state" => false), "menu" => array("edition" => true, "import" => true, "close" => true), ...))
091 
092                 $subAction = Yii::app()->request->getPost('subaction');
093                 if ($subAction != "upload") {
094                     $this->_showUploadForm($this->_getEncodingsArray(), $iSurveyId, $aData);
095                 } else {
096                     $this->_handleFileUpload($iSurveyId, $aData);
097                 }
098             } else {
099                 Yii::app()->session['flashmessage'] = gT("This survey is not active. You must activate the survey before attempting to import a VVexport file.");
100                 $this->getController()->redirect($this->getController()->createUrl("/admin/survey/sa/view/surveyid/{$iSurveyId}"));
101             }
#4
+
 /data/webdev/3LTS/application/core/Survey_Common_Action.php(83): CAction->runWithParamsInternal(dataentry, ReflectionMethod, array("r" => "admin/dataentry/sa/vvimport/surveyid/629533", "sa" => "vvimport", "surveyid" => "629533", "iSurveyId" => "629533", ...))
78             $oMethod = new ReflectionMethod($this, $sDefault);
79         }
80 
81         // We're all good to go, let's execute it
82         // runWithParamsInternal would automatically get the parameters of the method and populate them as required with the params
83         return parent::runWithParamsInternal($this, $oMethod, $params);
84     }
85 
86     /**
87      * Some functions have different parameters, which are just an alias of the
88      * usual parameters we're getting in the url. This function just populates
2021-10-25 12:27:22 nginx/1.18.0 Yii Framework/1.1.24-dev
Journal d'application
Heure Niveau Categorie Message
12:27:22.394759 error application.LimeExpressionManager
setVariableAndTokenMappingsForExpressionManager with an empty
surveyOptions.
12:27:22.455497 error php
Undefined offset: 1
(/data/webdev/3LTS/application/helpers/admin/import_helper.php:1977)
Stack trace:
#0 unknown(0): dataentry->vvimport()
#1 /data/webdev/3LTS/framework/web/actions/CAction.php(115):
ReflectionMethod->invokeArgs()
#2 /data/webdev/3LTS/application/core/Survey_Common_Action.php(83):
dataentry->runWithParamsInternal()
#3 /data/webdev/3LTS/framework/web/CController.php(308):
dataentry->runWithParams()
#4 /data/webdev/3LTS/framework/web/CController.php(286):
AdminController->runAction()
#5 /data/webdev/3LTS/framework/web/CController.php(265):
AdminController->runActionWithFilters()
#6 /data/webdev/3LTS/application/controllers/AdminController.php(165):
AdminController->run()
#7 /data/webdev/3LTS/framework/web/CWebApplication.php(282):
AdminController->run()
#8 /data/webdev/3LTS/framework/web/CWebApplication.php(141):
LSYii_Application->runController()
#9 /data/webdev/3LTS/framework/base/CApplication.php(185):
LSYii_Application->processRequest()
#10 /data/webdev/3LTS/index.php(193): LSYii_Application->run()
REQUEST_URI=/3LTS/index.php?r=admin/dataentry/sa/vvimport/surveyid/629533