diff options
author | dartcafe <github@dartcafe.de> | 2021-06-12 02:25:32 +0300 |
---|---|---|
committer | dartcafe <github@dartcafe.de> | 2021-06-12 02:25:32 +0300 |
commit | 5f7e4a5528773ff436c05fdaba02dcdf359430d3 (patch) | |
tree | de2ac38156e4c17a0e3cd83bb41bac44309fc455 /lib/Service/CommentService.php | |
parent | 874e27714de5ba9928a3bedb65e63ccd748aedba (diff) |
fix return valuev2.0.2
Signed-off-by: dartcafe <github@dartcafe.de>
Diffstat (limited to 'lib/Service/CommentService.php')
-rw-r--r-- | lib/Service/CommentService.php | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/lib/Service/CommentService.php b/lib/Service/CommentService.php index 1f5c18f9..4dc3c696 100644 --- a/lib/Service/CommentService.php +++ b/lib/Service/CommentService.php @@ -88,17 +88,15 @@ class CommentService { $this->acl->setPollId($pollId, Acl::PERMISSION_COMMENT_ADD); } - if ($message !== '') { - $this->comment = new Comment(); - $this->comment->setPollId($this->acl->getPollId()); - $this->comment->setUserId($this->acl->getUserId()); - $this->comment->setComment($message); - $this->comment->setDt(date('Y-m-d H:i:s')); - $this->comment->setTimestamp(time()); - $this->comment = $this->commentMapper->insert($this->comment); - $this->watchService->writeUpdate($this->comment->getPollId(), Watch::OBJECT_COMMENTS); - return $this->comment; - } + $this->comment = new Comment(); + $this->comment->setPollId($this->acl->getPollId()); + $this->comment->setUserId($this->acl->getUserId()); + $this->comment->setComment($message); + $this->comment->setDt(date('Y-m-d H:i:s')); + $this->comment->setTimestamp(time()); + $this->comment = $this->commentMapper->insert($this->comment); + $this->watchService->writeUpdate($this->comment->getPollId(), Watch::OBJECT_COMMENTS); + return $this->comment; } /** |