Fix form control when editing vote
This commit is contained in:
parent
8604cacc62
commit
7837c01ba0
@ -62,8 +62,8 @@ if (!empty($_POST['save'])) { // Save edition of an old vote
|
|||||||
$editedVote = filter_input(INPUT_POST, 'save', FILTER_VALIDATE_INT);
|
$editedVote = filter_input(INPUT_POST, 'save', FILTER_VALIDATE_INT);
|
||||||
$choices = $inputService->filterArray($_POST['choices'], FILTER_VALIDATE_REGEXP, ['options'=>['regexp'=>'/^[012]$/']]);
|
$choices = $inputService->filterArray($_POST['choices'], FILTER_VALIDATE_REGEXP, ['options'=>['regexp'=>'/^[012]$/']]);
|
||||||
|
|
||||||
if (empty($name)) {
|
if (empty($editedVote)) {
|
||||||
$message = new Message('danger', _('Name is incorrect.'));
|
$message = new Message('danger', _('Something is going wrong...'));
|
||||||
}
|
}
|
||||||
if (count($choices) != count($_POST['choices'])) {
|
if (count($choices) != count($_POST['choices'])) {
|
||||||
$message = new Message('danger', _('There is a problem with your choices.'));
|
$message = new Message('danger', _('There is a problem with your choices.'));
|
||||||
|
Loading…
Reference in New Issue
Block a user