Survey: Fix removing the last option in a question does not save the question title - CT#3279

pull/5081/head
christianbeeznst 2 years ago committed by Angel Fernando Quiroz Campos
parent 612f106906
commit b6447e3a1d
  1. 2
      public/main/survey/question.php
  2. 2
      public/main/survey/survey_question.php

@ -120,7 +120,7 @@ switch ($_GET['type']) {
}
// We are editing a question
if (isset($_GET['question_id']) && !empty($_GET['question_id'])) {
if (!empty($_GET['question_id'])) {
$formData = SurveyManager::get_question($_GET['question_id']);
}

@ -422,7 +422,7 @@ class survey_question
if ($key > $deleted) {
// swap with previous (deleted) option slot
$newAnswers[$key - 1] = $formData['answers'][$key];
$newAnswersId[$key - 1] = $formData['answersid'][$key];
$newAnswersId[$key - 1] = $formData['answersid'][$key] ?? 0;
unset($formData['answers'][$key]);
unset($formData['answersid'][$key]);
} elseif ($key === $deleted) {

Loading…
Cancel
Save