PHP warning

in_array() expects parameter 2 to be array, null given

/data/webdev/mastervanilla/application/helpers/common_helper.php(1293)

1281 * @return array
1282 */
1283 function createFieldMap($survey, $style = 'short', $force_refresh = false, $questionid = false, $sLanguage = '', &$aDuplicateQIDs = array())
1284 {
1285 
1286     $sLanguage = sanitize_languagecode($sLanguage);
1287     $surveyid = $survey->sid;
1288     //checks to see if fieldmap has already been built for this page.
1289     if (isset(Yii::app()->session['fieldmap-' . $surveyid . $sLanguage]) && !$force_refresh && $questionid === false) {
1290         return Yii::app()->session['fieldmap-' . $surveyid . $sLanguage];
1291     }
1292     /* Check if $sLanguage is a survey valid language (else $fieldmap is empty) */
1293     if ($sLanguage == '' || !in_array($sLanguage, $survey->allLanguages)) {
1294         $sLanguage = $survey->language;
1295     }
1296     $fieldmap = [];
1297     $fieldmap["id"] = array("fieldname" => "id", 'sid' => $surveyid, 'type' => "id", "gid" => "", "qid" => "", "aid" => "");
1298     if ($style == "full") {
1299         $fieldmap["id"]['title'] = "";
1300         $fieldmap["id"]['question'] = gT("Response ID");
1301         $fieldmap["id"]['group_name'] = "";
1302     }
1303 
1304     $fieldmap["submitdate"] = array("fieldname" => "submitdate", 'type' => "submitdate", 'sid' => $surveyid, "gid" => "", "qid" => "", "aid" => "");
1305     if ($style == "full") {

Stack Trace

#0
+
 /data/webdev/mastervanilla/application/helpers/common_helper.php(1293): in_array("en", null)
1288     //checks to see if fieldmap has already been built for this page.
1289     if (isset(Yii::app()->session['fieldmap-' . $surveyid . $sLanguage]) && !$force_refresh && $questionid === false) {
1290         return Yii::app()->session['fieldmap-' . $surveyid . $sLanguage];
1291     }
1292     /* Check if $sLanguage is a survey valid language (else $fieldmap is empty) */
1293     if ($sLanguage == '' || !in_array($sLanguage, $survey->allLanguages)) {
1294         $sLanguage = $survey->language;
1295     }
1296     $fieldmap = [];
1297     $fieldmap["id"] = array("fieldname" => "id", 'sid' => $surveyid, 'type' => "id", "gid" => "", "qid" => "", "aid" => "");
1298     if ($style == "full") {
#1
+
 /data/webdev/mastervanilla/application/helpers/expressions/em_manager_helper.php(3292): createFieldMap(null, "full", false, false, ...)
3287         if (empty($this->surveyOptions)) {
3288             /* Log it as error : this need some test */
3289             Yii::log('setVariableAndTokenMappingsForExpressionManager with an empty surveyOptions.', 'error', 'application.LimeExpressionManager');
3290         }
3291         // TODO - do I need to force refresh, or trust that createFieldMap will cache langauges properly?
3292         $fieldmap = createFieldMap($survey, $style = 'full', $forceRefresh, false, $_SESSION['LEMlang']);
3293         $this->sid = $surveyid;
3294         $this->sessid = 'survey_' . $this->sid;
3295         $this->runtimeTimings[] = [__METHOD__ . '.createFieldMap', (microtime(true) - $now)];
3296         //      LimeExpressionManager::ShowStackTrace();
3297 
#2
+
 /data/webdev/mastervanilla/application/helpers/expressions/em_manager_helper.php(4560): LimeExpressionManager->setVariableAndTokenMappingsForExpressionManager(null)
4555             $LEM->em->StartProcessingGroup(
4556                 isset($_SESSION['LEMsid']) ? $_SESSION['LEMsid'] : null,
4557                 '',
4558                 true
4559             );
4560             $LEM->setVariableAndTokenMappingsForExpressionManager($_SESSION['LEMsid']);
4561         }
4562     }
4563 
4564     /**
4565      * Initialize a survey so can use EM to manage navigation
2021-11-17 18:43:58 nginx/1.18.0 Yii Framework/1.1.24-dev