diff --git a/inc/form.class.php b/inc/form.class.php index bf2915395..e83285057 100644 --- a/inc/form.class.php +++ b/inc/form.class.php @@ -1156,6 +1156,10 @@ protected function showMyLastForms() { ] ] ], + 'ORDER' => [ + "$formAnswerTable.status ASC", + "$formAnswerTable.request_date DESC", + ], 'LIMIT' => 5, ]); if ($result->count() == 0) { diff --git a/inc/formanswer.class.php b/inc/formanswer.class.php index 1e93f6220..5f1aec2ab 100644 --- a/inc/formanswer.class.php +++ b/inc/formanswer.class.php @@ -750,14 +750,14 @@ public function pre_deleteItem() { */ public function saveAnswers(PluginFormcreatorForm $form, $data, $fields) { $formanswers_id = isset($data['id']) - ? intval($data['id']) + ? (int) $data['id'] : -1; $question = new PluginFormcreatorQuestion(); $questions = $question->getQuestionsFromForm($form->getID()); - // Update form answers if (isset($data['save_formanswer'])) { + // Update form answers $status = $data['status']; $this->update([ 'id' => $formanswers_id,