humhub / tasks

Intuitive task management tool with many basic and advanced features.
23 stars 34 forks source link

Error 400 when trying to assign the user for a task #179

Closed spwin closed 2 years ago

spwin commented 2 years ago

There is a bug when assigning a user to the task. Endpoint /tasks/task/task-assigned-picker returns error 400 with message about missing id.

spwin commented 2 years ago

The following change fixes it:

diff --git a/controllers/TaskController.php b/controllers/TaskController.php
index d1e86fb..58e6013 100644
--- a/controllers/TaskController.php
+++ b/controllers/TaskController.php
@@ -107,7 +107,7 @@ class TaskController extends AbstractTaskController
         return $this->asJson(['success' => $task->state->revert($status)]);
     }

-    public function actionTaskAssignedPicker($id = null, $keyword = '')
+    public function actionTaskAssignedPicker($keyword = '')
     {
         $query = $this->getSpace()->getMembershipUser();

@@ -118,7 +118,7 @@ class TaskController extends AbstractTaskController
         ]));
     }

-    public function actionTaskResponsiblePicker($id = null, $keyword = '')
+    public function actionTaskResponsiblePicker($keyword = '')
     {
         $query = $this->getSpace()->getMembershipUser();

Can you guys marge the fix? Thanks

luke- commented 2 years ago

@spwin Thanks for the fix. Can you please provide steps to reproduce?

spwin commented 2 years ago

It's happening when creating a new task in a Space and trying to assign a user

Screenshot from 2022-03-07 21-56-55

luke- commented 2 years ago

Hmm, cannot reproduce this, but it's clearly a bug. image

Thanks!

spwin commented 2 years ago

Hmm, cannot reproduce this, but it's clearly a bug. image

Thanks!

It’s only happening when running on localhost for me, maybe the validation is disabled on prod or php versions are different.

Thanks Luke!