MetaMagik icon indicating copy to clipboard operation
MetaMagik copied to clipboard

The task creator will always be current user when import a task.

Open uxyz-yang opened this issue 3 years ago • 2 comments

Please check line 97 in "NewTaskCreationModel.php", the creator will be overwritten by the current logged in user, even if the column of creator in the csv template is filled .

if ($this->userSession->isLogged()) {
        $values['creator_id'] = $this->userSession->getId();
}

I also checked the original creation model in Kanboard repository, seems that it also has the same issue. (not sure)

uxyz-yang avatar Jun 22 '22 04:06 uxyz-yang

I agree with the assessment, and would say that does indeed force the creator of a task to the "importee"

And I agree, this will happen in the native code of kanboard.

I could make an argument both ways though, so i am not really inclined to say it is an "issue". If you import a task, you are thus, the creator, which happens to fall into my definition of a "creator", however....why give someone the option to change the creator, and the behavior not work. It's like a "hahaha, gotcha ya" moment.

If I get a moment, i will update the code. If you want immediate solution:

if ($this->userSession->isLogged()) && !empty($values['creator_id']) {
        $values['creator_id'] = $this->userSession->getId();
}

might do the trick.

creecros avatar Jun 22 '22 12:06 creecros

Thank you for your reply, this is also my current solution. 👍

uxyz-yang avatar Jun 23 '22 03:06 uxyz-yang