PHP warning

Undefined array key 0

/var/www/html/limesurvey/application/controllers/QuestionAdministrationController.php(2964)

2952         $codes = [];
2953         foreach ($subquestionsArray as $subquestionId => $subquestionArray) {
2954             if (!isset($codes[$subquestionId])) {
2955                 $codes[$subquestionId] = [];
2956             }
2957             foreach ($subquestionArray as $scaleId => $data) {
2958                 if (!isset($codes[$scaleId])) {
2959                     $codes[$subquestionId][$scaleId] = [];
2960                 }
2961                 if (
2962                     in_array(
2963                         $data['code'],
2964                         $codes[$subquestionId][$scaleId]
2965                     )
2966                 ) {
2967                     throw (
2968                         new LSUserException(
2969                             500,
2970                             gT('Could not save subquestion')
2971                         )
2972                     )->setDetailedErrors(
2973                         ['Subquestion codes must be unique.']
2974                     );
2975                 }
2976                 $codes[$subquestionId][$scaleId][] = $data['code'];

Stack Trace

#0
+
 /var/www/html/limesurvey/application/controllers/QuestionAdministrationController.php(2883): QuestionAdministrationController->validateSubquestionCodes(array(array(array("code" => "SQ001", "subquestionl10n" => array("en" => ""), "relevance" => "1"))))
2878      * @return void
2879      * @throws CHttpException
2880      */
2881     private function storeSubquestions($question, $subquestionsArray)
2882     {
2883         $this->validateSubquestionCodes($subquestionsArray);
2884         $questionOrder = 0;
2885         $errorQuestions = [];
2886         $subquestions = [];
2887         foreach ($subquestionsArray as $subquestionId => $subquestionArray) {
2888             foreach ($subquestionArray as $scaleId => $data) {
#1
+
 /var/www/html/limesurvey/application/controllers/QuestionAdministrationController.php(567): QuestionAdministrationController->storeSubquestions(Question, array(array(array("code" => "SQ001", "subquestionl10n" => array("en" => ""), "relevance" => "1"))))
562             if ($question->survey->active == 'N') {
563                 // If question type has subquestions, save them.
564                 if ($question->questionType->subquestions > 0) {
565                     $this->storeSubquestions(
566                         $question,
567                         $request->getPost('subquestions')
568                     );
569                 }
570             } else {
571                 if ($question->questionType->subquestions > 0) {
572                     $this->updateSubquestions(
#6
+
 /var/www/html/limesurvey/application/controllers/LSBaseController.php(145): CController->run("saveQuestionData")
140                     $this->redirect(array('/admin/authentication/sa/login'));
141                 }
142             }
143         }
144 
145         parent::run($action);
146     }
147 
148     /**
149      * Load and set session vars
150      *
2023-10-06 10:23:44 nginx/1.18.0 Yii Framework/1.1.28