diff --git a/module/task/control.php b/module/task/control.php index 52c9914dff..cb810ed647 100755 --- a/module/task/control.php +++ b/module/task/control.php @@ -362,8 +362,9 @@ class task extends control $this->session->set('executionList', $this->app->getURI(true), 'execution'); // This allow get var of session as `$_SESSION['app-execution']['executionList']`. - $execution = $this->view->execution ?? $this->execution->getById($task->execution); - if(!helper::isAjaxRequest('modal') && $execution->type == 'kanban') + $execution = $this->view->execution ?? $this->execution->getById($task->execution); + $isModalOrApi = helper::isAjaxRequest('modal') || (defined('RUN_MODE') && RUN_MODE == 'api'); + if(!$isModalOrApi && $execution->type == 'kanban') { helper::setcookie('taskToOpen', (string)$taskID); return $this->send(array('load' => $this->createLink('execution', 'kanban', "executionID=$execution->id")));