From da73597e8bb8fe7bc0ec03530574b2ee0de49b7e Mon Sep 17 00:00:00 2001 From: liugang Date: Mon, 22 May 2023 14:32:25 +0800 Subject: [PATCH] * bug: return error message if bug doesn't exist. --- module/bug/control.php | 1 + module/bug/model.php | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/module/bug/control.php b/module/bug/control.php index c424c04763..cb9bad9a16 100755 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -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())); diff --git a/module/bug/model.php b/module/bug/model.php index e04cff7658..06ac633a53 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -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;