From 4c93d5fbcc1e5b8777ef26ea217c8de38d290fa6 Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Wed, 3 Oct 2007 22:42:05 +0000 Subject: Bug 398428: After creating or editing an attachment, immediately display the bug it belongs to - Patch by Frédéric Buclin r=ghendricks a=LpSolit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- attachment.cgi | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'attachment.cgi') diff --git a/attachment.cgi b/attachment.cgi index b60f0183b..13d225bdd 100755 --- a/attachment.cgi +++ b/attachment.cgi @@ -72,6 +72,12 @@ local our $vars = {}; # Determine whether to use the action specified by the user or the default. my $action = $cgi->param('action') || 'view'; +# Determine if PatchReader is installed +eval { + require PatchReader; + $vars->{'patchviewerinstalled'} = 1; +}; + if ($action eq "view") { view(); @@ -397,6 +403,10 @@ sub insert { $vars->{'mailrecipients'} = { 'changer' => $user->login, 'owner' => $owner }; $vars->{'attachment'} = $attachment; + # We cannot reuse the $bug object as delta_ts has eventually been updated + # since the object was created. + $vars->{'bugs'} = [new Bugzilla::Bug($bugid)]; + $vars->{'header_done'} = 1; $vars->{'contenttypemethod'} = $cgi->param('contenttypemethod'); print $cgi->header(); @@ -439,11 +449,6 @@ sub edit { $vars->{'bugsummary'} = $bugsummary; $vars->{'attachments'} = $bugattachments; - # Determine if PatchReader is installed - eval { - require PatchReader; - $vars->{'patchviewerinstalled'} = 1; - }; print $cgi->header(); # Generate and return the UI (HTML page) from the appropriate template. @@ -591,6 +596,10 @@ sub update { # Define the variables and functions that will be passed to the UI template. $vars->{'mailrecipients'} = { 'changer' => Bugzilla->user->login }; $vars->{'attachment'} = $attachment; + # We cannot reuse the $bug object as delta_ts has eventually been updated + # since the object was created. + $vars->{'bugs'} = [new Bugzilla::Bug($bug->id)]; + $vars->{'header_done'} = 1; print $cgi->header(); -- cgit v1.2.3-24-g4f1b