From c4f9c34f75bfcea445fdb41288cfe063c05438bb Mon Sep 17 00:00:00 2001 From: Tomas Dittmann Date: Fri, 18 Mar 2022 01:25:46 +0100 Subject: [PATCH] Reordering of subtask is not saved --- app/Controller/SubtaskController.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/Controller/SubtaskController.php b/app/Controller/SubtaskController.php index 8144d18f9..546dcb2ac 100644 --- a/app/Controller/SubtaskController.php +++ b/app/Controller/SubtaskController.php @@ -209,12 +209,11 @@ class SubtaskController extends BaseController */ public function movePosition() { - $project_id = $this->request->getIntegerParam('project_id'); - $task_id = $this->request->getIntegerParam('task_id'); + $task = $this->getTask(); $values = $this->request->getJson(); - if (! empty($values) && $this->helper->user->hasProjectAccess('SubtaskController', 'movePosition', $project_id)) { - $result = $this->subtaskPositionModel->changePosition($task_id, $values['subtask_id'], $values['position']); + if (! empty($values) && $this->helper->user->hasProjectAccess('SubtaskController', 'movePosition', $task['project_id'])) { + $result = $this->subtaskPositionModel->changePosition($task['id'], $values['subtask_id'], $values['position']); $this->response->json(array('result' => $result)); } else { throw new AccessForbiddenException();