aboutsummaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2005-08-16 01:48:13 +0000
committerlpsolit%gmail.com <>2005-08-16 01:48:13 +0000
commit74dd48c21d8b75ec8de225c4a653641a3460bf4f (patch)
tree5437c4aea1456d36eb1225de66e2e953e375b3cb /Bugzilla
parent044848e67b4134b9429f880774c9c6cf577226cc (diff)
downloadbugs-74dd48c21d8b75ec8de225c4a653641a3460bf4f.tar
bugs-74dd48c21d8b75ec8de225c4a653641a3460bf4f.tar.gz
bugs-74dd48c21d8b75ec8de225c4a653641a3460bf4f.tar.bz2
bugs-74dd48c21d8b75ec8de225c4a653641a3460bf4f.tar.xz
bugs-74dd48c21d8b75ec8de225c4a653641a3460bf4f.zip
Bug 304642: Bugzilla::Flag::GetTarget() should be called internally by Bugzilla::Flag::process() - Patch by Frédéric Buclin <LpSolit@gmail.com> r/a=myk
Diffstat (limited to 'Bugzilla')
-rw-r--r--Bugzilla/Flag.pm15
1 files changed, 8 insertions, 7 deletions
diff --git a/Bugzilla/Flag.pm b/Bugzilla/Flag.pm
index 6c5adf440..4c4864ea7 100644
--- a/Bugzilla/Flag.pm
+++ b/Bugzilla/Flag.pm
@@ -414,11 +414,12 @@ used to obtain the flag fields that the user submitted.
=cut
sub process {
- my ($target, $timestamp, $cgi) = @_;
+ my ($bug_id, $attach_id, $timestamp, $cgi) = @_;
my $dbh = Bugzilla->dbh;
- my $bug_id = $target->{'bug'}->{'id'};
- my $attach_id = $target->{'attachment'}->{'id'};
+ my $target = get_target($bug_id, $attach_id);
+ # Make sure the target exists.
+ return unless $target->{'exists'};
# Use the date/time we were given if possible (allowing calling code
# to synchronize the comment's timestamp with those of other records).
@@ -742,7 +743,7 @@ sub FormToNewFlags {
my @type_ids = map(/^flag_type-(\d+)$/ ? $1 : (), $cgi->param());
@type_ids = grep($cgi->param("flag_type-$_") ne 'X', @type_ids);
- return () unless (scalar(@type_ids) && $target->{'exists'});
+ return () unless scalar(@type_ids);
# Get information about the setter to add to each flag.
my $setter = new Bugzilla::User($::userid);
@@ -846,7 +847,7 @@ sub GetBug {
=over
-=item C<GetTarget($bug_id, $attach_id)>
+=item C<get_target($bug_id, $attach_id)>
Someone please document this function.
@@ -854,7 +855,7 @@ Someone please document this function.
=cut
-sub GetTarget {
+sub get_target {
my ($bug_id, $attach_id) = @_;
# Create an object representing the target bug/attachment.
@@ -1038,7 +1039,7 @@ sub perlify_record {
exists => $exists ,
id => $id ,
type => Bugzilla::FlagType::get($type_id) ,
- target => GetTarget($bug_id, $attach_id) ,
+ target => get_target($bug_id, $attach_id) ,
requestee => $requestee_id ? new Bugzilla::User($requestee_id) : undef,
setter => new Bugzilla::User($setter_id) ,
status => $status ,