Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/polls.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordartcafe <github@dartcafe.de>2021-06-12 02:25:32 +0300
committerdartcafe <github@dartcafe.de>2021-06-12 02:25:32 +0300
commit5f7e4a5528773ff436c05fdaba02dcdf359430d3 (patch)
treede2ac38156e4c17a0e3cd83bb41bac44309fc455
parent874e27714de5ba9928a3bedb65e63ccd748aedba (diff)
fix return valuev2.0.2
Signed-off-by: dartcafe <github@dartcafe.de>
-rw-r--r--lib/Service/CommentService.php20
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;
}
/**