Skip to content

Commit

Permalink
Fixes issues w/ reply_to field
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobemerick committed Jul 17, 2016
1 parent 39618d8 commit 4a3bcf6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/Controller/Comment.php
Expand Up @@ -108,13 +108,17 @@ public function createComment(Request $req, Response $res)
if (!empty($body['should_display'])) {
$shouldDisplay = (int) $body['should_display'];
}
$replyTo = 0;
if (!empty($body['reply_to'])) {
$replyTo = (int) $body['reply_to'];
}

$commentModel = new CommentModel($this->container->get('dbal'));
$commentId = $commentModel->create(
$commenter['id'],
$bodyId,
$locationId,
$body['reply_to'],
$replyTo,
$commentRequestId,
$body['url'],
(int) $body['should_notify'],
Expand Down
2 changes: 1 addition & 1 deletion src/Model/Comment.php
Expand Up @@ -46,7 +46,7 @@ public function create(
`comment` (`commenter`, `comment_body`, `comment_location`, `reply_to`, `comment_request`,
`url`, `notify`, `display`, `create_time`)
VALUES
(:commenter, :body, :location, :request, :url, :notify, :display, :create_time)";
(:commenter, :body, :location, :reply_to, :request, :url, :notify, :display, :create_time)";

$bindings = [
'commenter' => $commenter,
Expand Down

0 comments on commit 4a3bcf6

Please sign in to comment.