* bug: return error message if bug doesn't exist.
This commit is contained in:
@@ -985,6 +985,7 @@ class bug extends control
|
||||
parse_str($kanbanInfo, $kanbanParams);
|
||||
|
||||
$bugData = $this->bugZen->buildBugForActivate($bugID);
|
||||
if(!$bugData) return $this->send(array('result' => 'fail', 'message' => $this->lang->bug->error->notExist));
|
||||
|
||||
$this->bug->activate($bugData, $kanbanParams);
|
||||
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
|
||||
@@ -1040,7 +1040,11 @@ class bugModel extends model
|
||||
{
|
||||
$bugID = (int)$bug->id;
|
||||
$oldBug = $this->getBaseInfo($bugID);
|
||||
if(!$oldBug) return false;
|
||||
if(!$oldBug)
|
||||
{
|
||||
dao::$errors[] = $this->lang->bug->error->notExist;
|
||||
return false;
|
||||
}
|
||||
if($oldBug->status != 'resolved' && $oldBug->status != 'closed')
|
||||
{
|
||||
dao::$errors[] = $this->lang->bug->error->cannotActivate;
|
||||
|
||||
Reference in New Issue
Block a user