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(266)

254      * @param string $sFieldName
255      * @param string $sValue
256      * @return string
257      */
258     public function getShortAnswer($sFieldName, $sValue)
259     {
260         $aQuestion = $this->fieldMap[$sFieldName];
261         $sFieldType = $aQuestion['type'];
262 
263         switch ($sFieldType) {
264             case Question::QT_K_MULTIPLE_NUMERICAL:
265             case Question::QT_N_NUMERICAL:
266                 if (trim($sValue) != '') {
267                     if (strpos($sValue, ".") !== false) {
268                         $sValue = rtrim(rtrim($sValue, "0"), ".");
269                     }
270                 }
271                 break;
272         }
273 
274         return $sValue;
275     }
276 
277     /**
278      * Returns an array of possible answers to the question.  If $scaleId is

Stack Trace

#0
+
 /media/shnoulle/data/webdev/master/application/helpers/admin/export/SurveyObj.php(266): trim(null)
261         $sFieldType = $aQuestion['type'];
262 
263         switch ($sFieldType) {
264             case Question::QT_K_MULTIPLE_NUMERICAL:
265             case Question::QT_N_NUMERICAL:
266                 if (trim($sValue) != '') {
267                     if (strpos($sValue, ".") !== false) {
268                         $sValue = rtrim(rtrim($sValue, "0"), ".");
269                     }
270                 }
271                 break;
#1
+
 /media/shnoulle/data/webdev/master/application/helpers/admin/export/Writer.php(204): SurveyObj->getShortAnswer("282267X4X11", null)
199      * @return string
200      */
201     public function getShortAnswer(SurveyObj $oSurvey, FormattingOptions $oOptions, $fieldName, $sValue)
202     {
203         return $this->transformResponseValue(
204             $oSurvey->getShortAnswer($fieldName, $sValue),
205             $oSurvey->fieldMap[$fieldName]['type'],
206             $oOptions,
207             $fieldName
208         );
209     }
#2
+
 /media/shnoulle/data/webdev/master/application/helpers/admin/export/Writer.php(327): Writer->getShortAnswer(SurveyObj, FormattingOptions, "282267X4X11", null)
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;
329                     }
330                 } else {
331 //Survey participants table value
332                     $elementArray[] = $value;
2023-11-24 08:48:48 nginx/1.22.1 Yii Framework/1.1.28