Skip to content

Commit

Permalink
fix(form): my last form (validator) were not sorted
Browse files Browse the repository at this point in the history
Signed-off-by: Thierry Bugier <tbugier@teclib.com>
  • Loading branch information
btry committed Jan 7, 2020
1 parent ac2fbf9 commit 9ed9e87
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions inc/form.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1156,6 +1156,10 @@ protected function showMyLastForms() {
]
]
],
'ORDER' => [
"$formAnswerTable.status ASC",
"$formAnswerTable.request_date DESC",
],
'LIMIT' => 5,
]);
if ($result->count() == 0) {
Expand Down
4 changes: 2 additions & 2 deletions inc/formanswer.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 9ed9e87

Please sign in to comment.