We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7729fe2 commit 44e4ab6Copy full SHA for 44e4ab6
front/formanswer.form.php
@@ -45,14 +45,13 @@
45
$formanswer->update($_POST);
46
Html::back();
47
48
-} else if (isset($_POST['refuse_formanswer'])) {
49
- $formanswer->update($_POST);
50
- $formanswer->redirectToList();
51
-
52
-} else if (isset($_POST['accept_formanswer'])) {
53
54
55
+} else if (isset($_POST['refuse_formanswer']) || isset($_POST['accept_formanswer'])) {
+ if ($formanswer->update($_POST)) {
+ $formanswer->redirectToList();
+ }else{
+ //redirect to formanswer if update failed (ex : missing mandatory field)
+ Html::back();
+ }
56
} else if (isset($_POST['save_formanswer'])) {
57
if (!$formanswer->update($_POST)) {
58
0 commit comments