From 7837c01ba040404a41fc24a484dc63bdc7f037b5 Mon Sep 17 00:00:00 2001
From: Olivier PEREZ <olivier@olivierperez.fr>
Date: Wed, 17 Dec 2014 13:23:32 +0100
Subject: [PATCH] Fix form control when editing vote

---
 studs.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/studs.php b/studs.php
index 8f618067..042d4abb 100644
--- a/studs.php
+++ b/studs.php
@@ -62,8 +62,8 @@ if (!empty($_POST['save'])) { // Save edition of an old vote
     $editedVote = filter_input(INPUT_POST, 'save', FILTER_VALIDATE_INT);
     $choices = $inputService->filterArray($_POST['choices'], FILTER_VALIDATE_REGEXP, ['options'=>['regexp'=>'/^[012]$/']]);
 
-    if (empty($name)) {
-        $message = new Message('danger', _('Name is incorrect.'));
+    if (empty($editedVote)) {
+        $message = new Message('danger', _('Something is going wrong...'));
     }
     if (count($choices) != count($_POST['choices'])) {
         $message = new Message('danger', _('There is a problem with your choices.'));
-- 
GitLab