* Fix return value error of bug confirm function.

This commit is contained in:
wangyuting
2023-05-26 11:20:04 +08:00
parent 1cb55567e5
commit c20b492b8a
2 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -376,7 +376,7 @@ class bug extends control
$bug = form::data($this->config->bug->form->confirm)->add('id', $bugID)->setDefault('confirmed', 1)->get();
$bug = $this->loadModel('file')->processImgURL($bug, $this->config->bug->editor->confirm['id'], $this->post->uid);
$this->bug->confirm($bug, $kanbanData);
$changes = $this->bug->confirm($bug, $kanbanData);
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
+4 -4
View File
@@ -593,9 +593,9 @@ class bugModel extends model
* @param object $bug
* @param array $kanbanData
* @access public
* @return bool
* @return array|bool
*/
public function confirm(object $bug, array $kanbanData = array()): bool
public function confirm(object $bug, array $kanbanData = array()): array|bool
{
$oldBug = $this->getByID($bug->id);
@@ -619,9 +619,9 @@ class bugModel extends model
/* Record history. */
$changes = common::createChanges($oldBug, $bug);
$actionID = $this->loadModel('action')->create('bug', $oldBug->id, 'bugConfirmed', $this->post->comment);
$this->action->logHistory($actionID, $changes);
if($changes) $this->action->logHistory($actionID, $changes);
return !dao::isError();
return $changes;
}
/**