diff --git a/lib/api/api.class.php b/lib/api/api.class.php index 99ec4e2880..f5e1b00550 100755 --- a/lib/api/api.class.php +++ b/lib/api/api.class.php @@ -99,7 +99,7 @@ class ztclient $controlAPI = $this->zentao->root . $module . $this->zentao->requestFix . $method . $this->zentao->requestFix; if($vars) { - $vars = parse_str($vars); + parse_str($vars, $vars); foreach($vars as $var) $controlAPI .= $var . $this->zentao->requestFix; } $controlAPI = rtrim($controlAPI, $this->zentao->requestFix) . '.json'; diff --git a/module/task/control.php b/module/task/control.php index f48081ef92..c6c47eabff 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -173,11 +173,18 @@ class task extends control } $users = $this->loadModel('user')->getPairs('noclosed|nodeleted'); - $moduleIdList = $this->tree->getAllChildID($moduleID); - $stories = $this->story->getProjectStoryPairs($projectID, 0, 0, $moduleIdList); $members = $this->project->getTeamMemberPairs($projectID, 'nodeleted'); $moduleOptionMenu = $this->tree->getTaskOptionMenu($projectID); + /* Fix bug #2737. When moduleID is not story module. */ + $moduleIdList = array(); + if($moduleID) + { + $moduleID = $this->tree->getStoryModule($moduleID); + $moduleIdList = $this->tree->getAllChildID($moduleID); + } + $stories = $this->story->getProjectStoryPairs($projectID, 0, 0, $moduleIdList); + $title = $project->name . $this->lang->colon . $this->lang->task->create; $position[] = html::a($taskLink, $project->name); $position[] = $this->lang->task->common;