From 0d8aa2755abd5b62cbf0d8368b2e97a73bfcdd0d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20Buclin?= Date: Fri, 14 May 2010 15:31:14 +0200 Subject: [PATCH] Bug 565880: Do not throw an error when obsoleting an already obsolete attachment a=LpSolit --- Bugzilla/Attachment.pm | 10 +++++----- template/en/default/global/code-error.html.tmpl | 4 ---- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/Bugzilla/Attachment.pm b/Bugzilla/Attachment.pm index f3210425f0..33cb12bb6e 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 +=item C 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); } diff --git a/template/en/default/global/code-error.html.tmpl b/template/en/default/global/code-error.html.tmpl index 70dc64ab14..c91bc66eeb 100644 --- a/template/en/default/global/code-error.html.tmpl +++ b/template/en/default/global/code-error.html.tmpl @@ -43,10 +43,6 @@ I don't recognize the value ([% action FILTER html %]) of the action variable. - [% ELSIF error == "attachment_already_obsolete" %] - Attachment #[% attach_id FILTER html %] ([% description FILTER html %]) - is already obsolete. - [% ELSIF error == "attachment_local_storage_disabled" %] [% title = "Local Storage Disabled" %] You cannot store attachments locally. This feature is disabled. -- 2.47.3