* Finish task #6491.

This commit is contained in:
Yagami
2019-11-15 11:07:00 +08:00
parent 043ecb81c7
commit cc2c00797f
+9 -3
View File
@@ -912,10 +912,16 @@ class bugModel extends model
*/
public function resolve($bugID)
{
if(strpos($this->config->bug->resolve->requiredFields, 'comment') !== false and !$this->post->comment)
/* Check required fields before create build. */
$requiredFields = explode(',', trim($this->config->bug->resolve->requiredFields, ','));
foreach($requiredFields as $requiredField)
{
dao::$errors[] = sprintf($this->lang->error->notempty, $this->lang->comment);
return false;
if(!$this->post->$requiredField)
{
$tip = $requiredField == 'comment' ? $this->lang->comment : $this->lang->bug->$requiredField;
dao::$errors[] = sprintf($this->lang->error->notempty, $tip);
return false;
}
}
$now = helper::now();