summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Comment.pm
diff options
context:
space:
mode:
authorDavid Lawrence <dkl@mozilla.com>2016-09-20 15:48:07 +0200
committerDavid Lawrence <dkl@mozilla.com>2016-09-20 15:48:07 +0200
commit20c96f82ca2f624f57766adc44be087879f55d53 (patch)
treefbf24aaeeee39bdb25b6f430b0c7762347d71a21 /Bugzilla/Comment.pm
parenta2f813d8d4a129455feae4cb9b1fe97c23bac588 (diff)
downloadbugzilla-20c96f82ca2f624f57766adc44be087879f55d53.tar.gz
bugzilla-20c96f82ca2f624f57766adc44be087879f55d53.tar.xz
Bug 1303659 - Bug.comments (/rest/bug/<id>/comment) should return the count value in the results
Diffstat (limited to 'Bugzilla/Comment.pm')
-rw-r--r--Bugzilla/Comment.pm10
1 files changed, 5 insertions, 5 deletions
diff --git a/Bugzilla/Comment.pm b/Bugzilla/Comment.pm
index a8f915bfd..7c2d5c4ea 100644
--- a/Bugzilla/Comment.pm
+++ b/Bugzilla/Comment.pm
@@ -468,12 +468,12 @@ sub count {
my $dbh = Bugzilla->dbh;
($self->{'count'}) = $dbh->selectrow_array(
"SELECT COUNT(*)
- FROM longdescs
- WHERE bug_id = ?
- AND bug_when <= ?",
- undef, $self->bug_id, $self->creation_ts);
+ FROM longdescs
+ WHERE bug_id = ?
+ AND comment_id < ?",
+ undef, $self->bug_id, $self->id);
- return --$self->{'count'};
+ return $self->{'count'};
}
1;