Skip to content

Commit 71f1622

Browse files
committed
fixes for storing answers after rebase
Signed-off-by: Timotheus Pokorra <timotheus.pokorra@solidcharity.com>
1 parent abe53ba commit 71f1622

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

lib/Controller/ApiController.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -942,10 +942,7 @@ private function storeAnswersForQuestion($submissionId, array $question, array $
942942
$answerText = str_replace(Constants::QUESTION_EXTRASETTINGS_OTHER_PREFIX, "", $answer);
943943
}
944944

945-
// Load option-text
946-
$answerText = $option['text'];
947-
948-
$newAnswersText[] = $answerText;
945+
$newAnswerTexts[] = $answerText;
949946

950947
// has this answer already been stored?
951948
$foundAnswer = false;
@@ -1106,7 +1103,7 @@ public function updateSubmission(int $formId, array $answers, string $shareHash
11061103
if ($questionIndex === false) {
11071104
continue;
11081105
}
1109-
1106+
11101107
$question = $questions[$questionIndex];
11111108

11121109
$this->storeAnswersForQuestion($submission->getId(), $question, $answerArray, true);
@@ -1178,10 +1175,10 @@ public function insertSubmission(int $formId, array $answers, string $shareHash
11781175
$questionIndex = array_search($questionId, array_column($questions, 'id'));
11791176
if ($questionIndex === false) {
11801177
continue;
1181-
} else {
1182-
$question = $questions[$questionIndex];
11831178
}
11841179

1180+
$question = $questions[$questionIndex];
1181+
11851182
$this->storeAnswersForQuestion($submission->getId(), $question, $answerArray, false);
11861183
}
11871184

0 commit comments

Comments
 (0)