summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Bug.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Bugzilla/Bug.pm')
-rw-r--r--Bugzilla/Bug.pm32
1 files changed, 1 insertions, 31 deletions
diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm
index d8134e3cb..d55549cd6 100644
--- a/Bugzilla/Bug.pm
+++ b/Bugzilla/Bug.pm
@@ -2678,6 +2678,7 @@ sub comments {
my $count = 0;
foreach my $comment (@{ $self->{'comments'} }) {
$comment->{count} = $count++;
+ $comment->{bug} = $self;
}
}
my @comments = @{ $self->{'comments'} };
@@ -2973,37 +2974,6 @@ sub bug_alias_to_id {
# Subroutines
#####################################################################
-sub update_comment {
- my ($self, $comment_id, $new_comment) = @_;
-
- # Some validation checks.
- if ($self->{'error'}) {
- ThrowCodeError("bug_error", { bug => $self });
- }
- detaint_natural($comment_id)
- || ThrowCodeError('bad_arg', {argument => 'comment_id', function => 'update_comment'});
-
- # The comment ID must belong to this bug.
- my @current_comment_obj = grep {$_->id == $comment_id} @{$self->comments};
- scalar(@current_comment_obj)
- || ThrowCodeError('bad_arg', {argument => 'comment_id', function => 'update_comment'});
-
- # If the new comment is undefined, then there is nothing to update.
- # To delete a comment, an empty string should be passed.
- return unless defined $new_comment;
- $new_comment =~ s/\s*$//s; # Remove trailing whitespaces.
- $new_comment =~ s/\r\n?/\n/g; # Handle Windows and Mac-style line endings.
- trick_taint($new_comment);
-
- # We assume _check_comment() has already been called earlier.
- Bugzilla->dbh->do('UPDATE longdescs SET thetext = ? WHERE comment_id = ?',
- undef, ($new_comment, $comment_id));
- $self->_sync_fulltext();
-
- # Update the comment object with this new text.
- $current_comment_obj[0]->{'thetext'} = $new_comment;
-}
-
# Represents which fields from the bugs table are handled by process_bug.cgi.
sub editable_bug_fields {
my @fields = Bugzilla->dbh->bz_table_columns('bugs');