From 1cfaad05c540bdcb29c41048f27a97cfef86995e Mon Sep 17 00:00:00 2001 From: Dave Lawrence Date: Mon, 7 Nov 2011 16:21:06 -0500 Subject: Subroutine post_bug_after_creation redefined at ./extensions/REMO/Extension.pm --- extensions/REMO/Extension.pm | 94 -------------------------------------------- 1 file changed, 94 deletions(-) (limited to 'extensions/REMO') diff --git a/extensions/REMO/Extension.pm b/extensions/REMO/Extension.pm index fa412d87e..3df35357a 100644 --- a/extensions/REMO/Extension.pm +++ b/extensions/REMO/Extension.pm @@ -230,98 +230,4 @@ sub post_bug_after_creation { } } -sub post_bug_after_creation { - my ($self, $args) = @_; - my $vars = $args->{vars}; - my $bug = $vars->{bug}; - my $template = Bugzilla->template; - - if (Bugzilla->input_params->{format} eq 'remo-swag') { - # If the attachment cannot be successfully added to the bug, - # we notify the user, but we don't interrupt the bug creation process. - my $error_mode_cache = Bugzilla->error_mode; - Bugzilla->error_mode(ERROR_MODE_DIE); - - my $attachment; - eval { - my $xml; - $template->process("bug/create/create-remo-swag.xml.tmpl", {}, \$xml) - || ThrowTemplateError($template->error()); - - $attachment = Bugzilla::Attachment->create( - { bug => $bug, - creation_ts => $bug->creation_ts, - data => $xml, - description => 'Remo Swag Request (XML)', - filename => 'remo-swag.xml', - ispatch => 0, - isprivate => 0, - isurl => 0, - mimetype => 'text/xml', - store_in_file => 0, - }); - }; - - if ($attachment) { - # Insert comment for attachment - $bug->add_comment('', { isprivate => 0, - type => CMT_ATTACHMENT_CREATED, - extra_data => $attachment->id }); - $bug->update($bug->creation_ts); - } - else { - $vars->{'message'} = 'attachment_creation_failed'; - } - - Bugzilla->error_mode($error_mode_cache); - } -} - -sub post_bug_after_creation { - my ($self, $args) = @_; - my $vars = $args->{vars}; - my $bug = $vars->{bug}; - my $template = Bugzilla->template; - - if (Bugzilla->input_params->{format} eq 'remo-swag') { - # If the attachment cannot be successfully added to the bug, - # we notify the user, but we don't interrupt the bug creation process. - my $error_mode_cache = Bugzilla->error_mode; - Bugzilla->error_mode(ERROR_MODE_DIE); - - my $attachment; - eval { - my $xml; - $template->process("bug/create/create-remo-swag.xml.tmpl", {}, \$xml) - || ThrowTemplateError($template->error()); - - $attachment = Bugzilla::Attachment->create( - { bug => $bug, - creation_ts => $bug->creation_ts, - data => $xml, - description => 'Remo Swag Request (XML)', - filename => 'remo-swag.xml', - ispatch => 0, - isprivate => 0, - isurl => 0, - mimetype => 'text/xml', - store_in_file => 0, - }); - }; - - if ($attachment) { - # Insert comment for attachment - $bug->add_comment('', { isprivate => 0, - type => CMT_ATTACHMENT_CREATED, - extra_data => $attachment->id }); - $bug->update($bug->creation_ts); - } - else { - $vars->{'message'} = 'attachment_creation_failed'; - } - - Bugzilla->error_mode($error_mode_cache); - } -} - __PACKAGE__->NAME; -- cgit v1.2.3-24-g4f1b