RZetko / kanboard-organizations-plugins

Kanboard Plugin to add organizations to tasks
MIT License
2 stars 1 forks source link

The organization is not saved when creating a new task #1

Open kicorangel opened 7 years ago

kicorangel commented 7 years ago

Dear,

The organization is not saved when creating a new task, only when updating an existing one.

I have changed the TaskCreationModel as described, but when the afterSaveTask is called, no information about the "organization" is available. Concretely, it seems that $this->request->getBody() is empty.

Can anyone provide with a solution?

Thank you,

Francisco Rangel

RZetko commented 7 years ago

Hi

I just tested it on our installation which is version 1.0.34 and it's working correctly on that version. I looked at later versions and there shouldn't be any breaking changes.

Could you please give me your Kanboard version and snippet of your TaskCreationModel please? I'll try to find out what's causing the issue.

Thank you.

kicorangel commented 7 years ago

Hi,

Our Kanboard version is 1.0.44. Below our TaskCreationModel. Thank you for your help.

namespace Kanboard\Model; use Kanboard\Core\Base;

/**

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

    $values['swimlane_id'] = empty($values['swimlane_id']) ? $this->swimlaneModel->getFirstActiveSwimlaneId($values['project_id']) : $values['swimlane_id'];
    $values['date_creation'] = time();
    $values['date_modification'] = $values['date_creation'];
    $values['date_moved'] = $values['date_creation'];
    $values['position'] = $this->taskFinderModel->countByColumnAndSwimlaneId($values['project_id'], $values['column_id'], $values['swimlane_id']) + 1;

    $this->hook->reference('model:task:creation:prepare', $values);
}

}