summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Attachment.pm
diff options
context:
space:
mode:
authorFrédéric Buclin <LpSolit@gmail.com>2010-05-14 15:31:14 +0200
committerFrédéric Buclin <LpSolit@gmail.com>2010-05-14 15:31:14 +0200
commit0d8aa2755abd5b62cbf0d8368b2e97a73bfcdd0d (patch)
tree1c0be7366e8de0e45edf1337d2fbc4584feb372b /Bugzilla/Attachment.pm
parent1f1d6a5bcd5b77e8fbb8d827a614cdc1e3323c4d (diff)
downloadbugzilla-0d8aa2755abd5b62cbf0d8368b2e97a73bfcdd0d.tar.gz
bugzilla-0d8aa2755abd5b62cbf0d8368b2e97a73bfcdd0d.tar.xz
Bug 565880: Do not throw an error when obsoleting an already obsolete attachment
a=LpSolit
Diffstat (limited to 'Bugzilla/Attachment.pm')
-rw-r--r--Bugzilla/Attachment.pm10
1 files changed, 5 insertions, 5 deletions
diff --git a/Bugzilla/Attachment.pm b/Bugzilla/Attachment.pm
index f3210425f..33cb12bb6 100644
--- a/Bugzilla/Attachment.pm
+++ b/Bugzilla/Attachment.pm
@@ -734,7 +734,7 @@ sub validate_can_edit {
&& $user->in_group('editbugs', $product_id))) ? 1 : 0;
}
-=item C<validate_obsolete($bug)>
+=item C<validate_obsolete($bug, $attach_ids)>
Description: validates if attachments the user wants to mark as obsolete
really belong to the given bug and are not already obsolete.
@@ -742,8 +742,10 @@ Description: validates if attachments the user wants to mark as obsolete
he cannot view it (due to restrictions on it).
Params: $bug - The bug object obsolete attachments should belong to.
+ $attach_ids - The list of attachments to mark as obsolete.
-Returns: 1 on success. Else an error is thrown.
+Returns: The list of attachment objects to mark as obsolete.
+ Else an error is thrown.
=cut
@@ -777,9 +779,7 @@ sub validate_obsolete {
ThrowCodeError('mismatched_bug_ids_on_obsolete', $vars);
}
- if ($attachment->isobsolete) {
- ThrowCodeError('attachment_already_obsolete', $vars);
- }
+ next if $attachment->isobsolete;
push(@obsolete_attachments, $attachment);
}