* Fix return value error of bug confirm function.
This commit is contained in:
@@ -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()));
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user