creecros / MetaMagik

Custom Fields for Kanboard - Plugin MetaMagik
MIT License
98 stars 16 forks source link

Cannot unassign tasks when MetaMagik is active #87

Closed cornercase closed 1 year ago

cornercase commented 1 year ago

I recently installed MetaMagik 1.5.2 on Kanboard v1.2.22 (later tried with 1.2.26, same behavior demonstrated). I found that when MetaMagik is active, I cannot unassign a task that has been assigned to a user . If I create a task without assigning a user, it will be unassigned. However, once any user has been assigned, I am able to change the assignee to a different user, but can never set the task back to unassigned. This is in contrast to standard Kanboard behavior, in which a task can be unassigned. If I attempt to unassign a task, when the task is saved, it remains assigned to the user to which it was previously assigned.

OS: Ubuntu Server 20.04.03 LTS PHP version: 7.4 Web server: Apache 2.4 Other details: external auth against a FreeIPA server is configured

creecros commented 1 year ago

are there other plugins invloved?

creecros commented 1 year ago

nevermind, i found the issue.

It's caused by line 36 of the NewTaskModificationModel in this commit: a1a3b91ba82db29524b56fe8a73e7393b6a8e46a

$values = array_filter($values);

Not sure why this was added, but I will look into it, and see about a fix.

I'll have to look at the other models and see if anything fishy is going on there as well

creecros commented 1 year ago

And after further investigation, this is definately the issue.

image

there is no callback in the array_filter $values = array_filter($values);

https://www.php.net/manual/en/function.array-filter.php

Before I just go and remove it, i need to really examine the PR that @tvhdev added, make sure I don't screw something else up.

cornercase commented 1 year ago

Thanks for looking into this, I'm happy to do any testing if it's helpful.