diff options
author | travis%sedsystems.ca <> | 2005-03-16 06:08:12 +0000 |
---|---|---|
committer | travis%sedsystems.ca <> | 2005-03-16 06:08:12 +0000 |
commit | 235eaf8436a7cb2f693c3fb8bc5d042c652c1c5f (patch) | |
tree | 357e8cee9c59c0afe004d3e8934a257c22fd5305 | |
parent | 66172e4cc43bafb5a89f855260b2053e63af4463 (diff) | |
download | bugs-235eaf8436a7cb2f693c3fb8bc5d042c652c1c5f.tar bugs-235eaf8436a7cb2f693c3fb8bc5d042c652c1c5f.tar.gz bugs-235eaf8436a7cb2f693c3fb8bc5d042c652c1c5f.tar.bz2 bugs-235eaf8436a7cb2f693c3fb8bc5d042c652c1c5f.tar.xz bugs-235eaf8436a7cb2f693c3fb8bc5d042c652c1c5f.zip |
Fix nits on bug 180652 - Frederic Buclin
-rw-r--r-- | Bugzilla/Flag.pm | 14 | ||||
-rwxr-xr-x | attachment.cgi | 7 |
2 files changed, 8 insertions, 13 deletions
diff --git a/Bugzilla/Flag.pm b/Bugzilla/Flag.pm index 6d1abfdd9..ea60eebe4 100644 --- a/Bugzilla/Flag.pm +++ b/Bugzilla/Flag.pm @@ -273,7 +273,7 @@ sub process { # Take a snapshot of flags before any changes. my @old_summaries = snapshot($bug_id, $attach_id); - # Cancel old request flags if we are obsoleting an attachment. + # Cancel pending requests if we are obsoleting an attachment. if ($attach_id && $data->{'isobsolete'}) { CancelRequests($bug_id, $attach_id); } @@ -297,9 +297,7 @@ sub process { AND i.type_id IS NULL", undef, $bug_id); - foreach my $flag_id (@$flag_ids) { - clear($flag_id); - } + foreach my $flag_id (@$flag_ids) { clear($flag_id) } $flag_ids = $dbh->selectcol_arrayref( "SELECT flags.id @@ -312,9 +310,7 @@ sub process { AND (bugs.component_id = e.component_id OR e.component_id IS NULL)", undef, $bug_id); - foreach my $flag_id (@$flag_ids) { - clear($flag_id); - } + foreach my $flag_id (@$flag_ids) { clear($flag_id) } # Take a snapshot of flags after changes. my @new_summaries = snapshot($bug_id, $attach_id); @@ -681,9 +677,7 @@ sub CancelRequests { # Take a snapshot of flags before any changes. my @old_summaries = snapshot($bug_id, $attach_id) if ($timestamp); - foreach my $flag (@$request_ids) { - clear($flag); - } + foreach my $flag (@$request_ids) { clear($flag) } # If $timestamp is undefined, do not update the activity table return unless ($timestamp); diff --git a/attachment.cgi b/attachment.cgi index 5f50efb03..bffba5bc4 100755 --- a/attachment.cgi +++ b/attachment.cgi @@ -1152,9 +1152,10 @@ sub update SendSQL("SELECT NOW()"); my $timestamp = FetchOneColumn(); - # Update flags. These calls must be done before updating the - # 'attachments' table due to the deletion of request flags - # on attachments being obsoleted. + # Update flags. We have to do this before committing changes + # to attachments so that we can delete pending requests if the user + # is obsoleting this attachment without deleting any requests + # the user submits at the same time. my $target = Bugzilla::Flag::GetTarget(undef, $::FORM{'id'}); Bugzilla::Flag::process($target, $timestamp, \%::FORM); |