PHP error

trim(): Passing null to parameter #1 ($string) of type string is deprecated

/media/shnoulle/data/webdev/master/application/helpers/admin/export/SurveyObj.php(104)

092         if ($questionId) {
093             $answers = $this->getAnswers($questionId);
094             if (isset($answers[$answerCode])) {
095                 $answer = $answers[$answerCode];
096             }
097         }
098 
099         //echo "\n$fieldName: $fieldType = $answerCode";
100         switch ($fieldType) {
101             case Question::QT_K_MULTIPLE_NUMERICAL:
102             case Question::QT_N_NUMERICAL:
103                 $fullAnswer = $answerCode;
104                 if (trim($fullAnswer) !== '') {
105                     // SQL DECIMAL
106                     if ($fullAnswer[0] === ".") {
107                         $fullAnswer = "0" . $fullAnswer;
108                     }
109                     if (strpos($fullAnswer, ".") !== false) {
110                         $fullAnswer = rtrim(rtrim($fullAnswer, "0"), ".");
111                     }
112                     $qidattributes = QuestionAttribute::model()->getQuestionAttributes($questionId);
113                     if (isset($qidattributes['num_value_int_only']) && $qidattributes['num_value_int_only']) {
114                         $fullAnswer = number_format($fullAnswer, 0, '', '');
115                     }
116                 }

Stack Trace

#0
+
 /media/shnoulle/data/webdev/master/application/helpers/admin/export/SurveyObj.php(104): trim(null)
099         //echo "\n$fieldName: $fieldType = $answerCode";
100         switch ($fieldType) {
101             case Question::QT_K_MULTIPLE_NUMERICAL:
102             case Question::QT_N_NUMERICAL:
103                 $fullAnswer = $answerCode;
104                 if (trim($fullAnswer) !== '') {
105                     // SQL DECIMAL
106                     if ($fullAnswer[0] === ".") {
107                         $fullAnswer = "0" . $fullAnswer;
108                     }
109                     if (strpos($fullAnswer, ".") !== false) {
#1
+
 /media/shnoulle/data/webdev/master/application/helpers/admin/export/Writer.php(185): SurveyObj->getFullAnswer("282267X4X11", null, Translator, "en")
180      * @return string
181      */
182     public function getLongAnswer(SurveyObj $oSurvey, FormattingOptions $oOptions, $fieldName, $sValue)
183     {
184         return $this->transformResponseValue(
185             $oSurvey->getFullAnswer($fieldName, $sValue, $this->translator, $this->languageCode),
186             $oSurvey->fieldMap[$fieldName]['type'],
187             $oOptions,
188             $fieldName
189         );
190     }
#2
+
 /media/shnoulle/data/webdev/master/application/helpers/admin/export/Writer.php(323): Writer->getLongAnswer(SurveyObj, FormattingOptions, "282267X4X11", null)
318             foreach ($oOptions->selectedColumns as $column) {
319                 $value = $aResponse[$column];
320                 if (isset($oSurvey->fieldMap[$column]) && $oSurvey->fieldMap[$column]['type'] != 'answer_time' && $oSurvey->fieldMap[$column]['type'] != 'page_time' && $oSurvey->fieldMap[$column]['type'] != 'interview_time') {
321                     switch ($oOptions->answerFormat) {
322                         case 'long':
323                             $elementArray[] = $this->getLongAnswer($oSurvey, $oOptions, $column, $value);
324                             break;
325                         default:
326                         case 'short':
327                             $elementArray[] = $this->getShortAnswer($oSurvey, $oOptions, $column, $value);
328                             break;
2023-11-24 08:45:54 nginx/1.22.1 Yii Framework/1.1.28