diff --git a/module/execution/model.php b/module/execution/model.php index 937402ee6b..fabfd73142 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -472,10 +472,6 @@ class executionModel extends model return false; } - /* Get team and language item. */ - $team = $this->loadModel('user')->getTeamMemberPairs($executionID, 'execution'); - $this->lang->execution->team = $this->lang->execution->teamname; - /* Get the data from the post. */ $execution = fixer::input('post') ->setDefault('lastEditedBy', $this->app->user->account) @@ -527,6 +523,12 @@ class executionModel extends model ->limit(1) ->exec(); + if($oldExecution->type == 'kanban') $this->dao->delete()->from(TABLE_TEAM)->where('root')->eq((int)$executionID)->exec(); + + /* Get team and language item. */ + $this->lang->execution->team = $this->lang->execution->teamname; + $team = $this->loadModel('user')->getTeamMemberPairs($executionID, 'execution'); + $changedAccounts = array(); $teamMembers = array(); foreach($this->config->execution->ownerFields as $ownerField)