* Fix bug#20878.

This commit is contained in:
xieqiyu
2022-03-25 14:15:30 +08:00
parent 01310e31ce
commit 39123bd4d9
2 changed files with 9 additions and 3 deletions
+1
View File
@@ -684,6 +684,7 @@ class bug extends control
if(!empty($_POST))
{
$actions = $this->bug->batchCreate($productID, $branch, $extra);
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
/* Return bug id list when call the API. */
if($this->viewType == 'json')
+8 -3
View File
@@ -235,7 +235,8 @@ class bugModel extends model
$field = trim($field);
if($field and empty($bug->$field))
{
return print(js::alert(sprintf($this->lang->error->notempty, $this->lang->bug->$field)));
dao::$errors['message'][] = sprintf($this->lang->error->notempty, $this->lang->bug->$field);
return false;
}
}
@@ -282,7 +283,7 @@ class bugModel extends model
->autoCheck()
->batchCheck($this->config->bug->create->requiredFields, 'notempty')
->exec();
if(dao::isError()) return print(js::error(dao::getError()));
if(dao::isError()) return false;
$bugID = $this->dao->lastInsertID();
@@ -309,7 +310,11 @@ class bugModel extends model
unset($file);
}
if(dao::isError()) return print(js::error('bug#' . ($i) . dao::getError(true)));
if(dao::isError())
{
dao::$errors['message'][] = 'bug#' . ($i) . dao::getError(true);
return false;
}
$actions[$bugID] = $this->action->create('bug', $bugID, 'Opened');
}