Small fixes

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2018-05-25 10:57:46 +02:00
parent ad450e2798
commit 2e3fe1dcd3
No known key found for this signature in database
GPG Key ID: A061B9DDE0CA0773
2 changed files with 12 additions and 7 deletions

View File

@ -47,6 +47,17 @@ $max_expiry_time = $pollService->maxExpiryDate();
$form = unserialize($_SESSION['form']); $form = unserialize($_SESSION['form']);
// The poll format is AUTRE (other) if we are in this file
if (!isset($form->format)) {
$form->format = 'A';
}
// The poll format is AUTRE (other)
if ($form->format !== 'A') {
$form->format = 'A';
$form->clearChoices();
}
if (!isset($form->title) || !isset($form->admin_name) || ($config['use_smtp'] && !isset($form->admin_mail))) { if (!isset($form->title) || !isset($form->admin_name) || ($config['use_smtp'] && !isset($form->admin_mail))) {
$step = 1; $step = 1;
} elseif (isset($_POST['confirmation'])) { } elseif (isset($_POST['confirmation'])) {
@ -57,12 +68,6 @@ if (!isset($form->title) || !isset($form->admin_name) || ($config['use_smtp'] &&
$step = 3; $step = 3;
} }
// The poll format is AUTRE (other)
if ($form->format !== 'A') {
$form->format = 'A';
$form->clearChoices();
}
switch ($step) { switch ($step) {
case 2: // Step 2/4 : Select choices of the poll case 2: // Step 2/4 : Select choices of the poll
$choices = $form->getChoices(); $choices = $form->getChoices();

View File

@ -51,7 +51,7 @@ if (!isset($form->format)) {
$form->format = 'D'; $form->format = 'D';
} }
// If we come from another format, we need to clear choices // If we come from another format, we need to clear choices
if (isset($form->format) && $form->format !== 'D') { if ($form->format !== 'D') {
$form->format = 'D'; $form->format = 'D';
$form->clearChoices(); $form->clearChoices();
} }