summaryrefslogtreecommitdiffstats
path: root/extensions/MyDashboard/lib
diff options
context:
space:
mode:
authorByron Jones <bjones@mozilla.com>2014-02-12 06:12:17 +0100
committerByron Jones <bjones@mozilla.com>2014-02-12 06:12:17 +0100
commit3fecb5fbc0e8f4305bb626d58de6e0c47a862d05 (patch)
tree1dec839a1ca3d2d7ea08441dd6abc1a89b197f45 /extensions/MyDashboard/lib
parenta1da4205492830a812f5661ee3b4faa224844b85 (diff)
downloadbugzilla-3fecb5fbc0e8f4305bb626d58de6e0c47a862d05.tar.gz
bugzilla-3fecb5fbc0e8f4305bb626d58de6e0c47a862d05.tar.xz
Bug 967910: "IO request failed : undefined" on My Dashboard
Diffstat (limited to 'extensions/MyDashboard/lib')
-rw-r--r--extensions/MyDashboard/lib/WebService.pm14
1 files changed, 11 insertions, 3 deletions
diff --git a/extensions/MyDashboard/lib/WebService.pm b/extensions/MyDashboard/lib/WebService.pm
index 29abbb3a3..806976372 100644
--- a/extensions/MyDashboard/lib/WebService.pm
+++ b/extensions/MyDashboard/lib/WebService.pm
@@ -38,6 +38,15 @@ sub run_bug_query {
next if $qdef->{name} ne $params->{query};
my ($bugs, $query_string) = query_bugs($qdef);
+ my $last_comment_sql = "
+ SELECT comment_id
+ FROM longdescs
+ WHERE bug_id = ? AND bug_when > ?";
+ if (!$user->is_insider) {
+ $last_comment_sql .= " AND isprivate = 0";
+ }
+ my $last_comment_sth = $dbh->prepare($last_comment_sql);
+
# Add last changes to each bug
foreach my $b (@$bugs) {
my $last_changes = {};
@@ -57,9 +66,8 @@ sub run_bug_query {
$last_changes->{email} = $change_set->{who};
$last_changes->{when} = $self->datetime_format_inbound($change_set->{when});
}
- my $last_comment_id = $dbh->selectrow_array("
- SELECT comment_id FROM longdescs
- WHERE bug_id = ? AND bug_when > ?",
+ my $last_comment_id = $dbh->selectrow_array(
+ $last_comment_sth,
undef, $b->{bug_id}, $changed_date);
if ($last_comment_id) {
my $comments = $self->comments({ comment_ids => [ $last_comment_id ] });