Bug with MetaMagik


Since KB 1.2.27 (and still in KB 1.2.28), when someone create a new task, the creator_id value in the tasks table stays at 0. I found that if I remove the MetaMagik plugin, then create a new task, the creator_id is filled with the correct user ID.

I fixed it by replacing this code from the NewTaskCreationModel.php file

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

By this

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

It works but I don’t know if this is the correct way to do it


Best to make an issue report on github for this. I am unaware of bugs unless they get reported. Ill look into it.

ok, it was caused by this issue, which I thought i fixed, but my brain was apparently working backwards.

it should have been:

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

Fixed in Version 1.5.5:

Thank you for the quick fix!