Commit 235eaf84 authored by travis%sedsystems.ca's avatar travis%sedsystems.ca

Fix nits on bug 180652 - Frederic Buclin

parent 66172e4c
...@@ -273,7 +273,7 @@ sub process { ...@@ -273,7 +273,7 @@ sub process {
# Take a snapshot of flags before any changes. # Take a snapshot of flags before any changes.
my @old_summaries = snapshot($bug_id, $attach_id); 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'}) { if ($attach_id && $data->{'isobsolete'}) {
CancelRequests($bug_id, $attach_id); CancelRequests($bug_id, $attach_id);
} }
...@@ -297,9 +297,7 @@ sub process { ...@@ -297,9 +297,7 @@ sub process {
AND i.type_id IS NULL", AND i.type_id IS NULL",
undef, $bug_id); undef, $bug_id);
foreach my $flag_id (@$flag_ids) { foreach my $flag_id (@$flag_ids) { clear($flag_id) }
clear($flag_id);
}
$flag_ids = $dbh->selectcol_arrayref( $flag_ids = $dbh->selectcol_arrayref(
"SELECT flags.id "SELECT flags.id
...@@ -312,9 +310,7 @@ sub process { ...@@ -312,9 +310,7 @@ sub process {
AND (bugs.component_id = e.component_id OR e.component_id IS NULL)", AND (bugs.component_id = e.component_id OR e.component_id IS NULL)",
undef, $bug_id); undef, $bug_id);
foreach my $flag_id (@$flag_ids) { foreach my $flag_id (@$flag_ids) { clear($flag_id) }
clear($flag_id);
}
# Take a snapshot of flags after changes. # Take a snapshot of flags after changes.
my @new_summaries = snapshot($bug_id, $attach_id); my @new_summaries = snapshot($bug_id, $attach_id);
...@@ -681,9 +677,7 @@ sub CancelRequests { ...@@ -681,9 +677,7 @@ sub CancelRequests {
# Take a snapshot of flags before any changes. # Take a snapshot of flags before any changes.
my @old_summaries = snapshot($bug_id, $attach_id) if ($timestamp); my @old_summaries = snapshot($bug_id, $attach_id) if ($timestamp);
foreach my $flag (@$request_ids) { foreach my $flag (@$request_ids) { clear($flag) }
clear($flag);
}
# If $timestamp is undefined, do not update the activity table # If $timestamp is undefined, do not update the activity table
return unless ($timestamp); return unless ($timestamp);
......
...@@ -1152,9 +1152,10 @@ sub update ...@@ -1152,9 +1152,10 @@ sub update
SendSQL("SELECT NOW()"); SendSQL("SELECT NOW()");
my $timestamp = FetchOneColumn(); my $timestamp = FetchOneColumn();
# Update flags. These calls must be done before updating the # Update flags. We have to do this before committing changes
# 'attachments' table due to the deletion of request flags # to attachments so that we can delete pending requests if the user
# on attachments being obsoleted. # is obsoleting this attachment without deleting any requests
# the user submits at the same time.
my $target = Bugzilla::Flag::GetTarget(undef, $::FORM{'id'}); my $target = Bugzilla::Flag::GetTarget(undef, $::FORM{'id'});
Bugzilla::Flag::process($target, $timestamp, \%::FORM); Bugzilla::Flag::process($target, $timestamp, \%::FORM);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment