From 71979bcbe3e1edaab5ca8ef8e22b43b1296a6136 Mon Sep 17 00:00:00 2001 From: "gerv%gerv.net" <> Date: Sat, 14 Feb 2004 04:24:51 +0000 Subject: Bug 233645 - fix a number of 'undef' warnings which were killing performance for multiple bug change. Patch by gerv; r,a=justdave. --- buglist.cgi | 2 +- globals.pl | 2 +- process_bug.cgi | 10 ++++++++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/buglist.cgi b/buglist.cgi index c33ea6238..ab7373e06 100755 --- a/buglist.cgi +++ b/buglist.cgi @@ -305,7 +305,7 @@ if ($::FORM{'cmdtype'} eq "dorem") { exit; } } -elsif ($::FORM{'cmdtype'} eq "doit") { +elsif (($::FORM{'cmdtype'} eq "doit") && $::FORM{'remtype'}) { if ($::FORM{'remtype'} eq "asdefault") { confirm_login(); my $userid = DBNameToIdAndCheck($::COOKIE{"Bugzilla_login"}); diff --git a/globals.pl b/globals.pl index 825c30af7..9c1b9a7ef 100644 --- a/globals.pl +++ b/globals.pl @@ -829,7 +829,7 @@ sub get_product_name { sub get_component_id { my ($prod_id, $comp) = @_; - return undef unless ($prod_id =~ /^\d+$/); + return undef unless ($prod_id && ($prod_id =~ /^\d+$/)); PushGlobalSQLState(); SendSQL("SELECT id FROM components " . "WHERE product_id = $prod_id AND name = " . SqlQuote($comp)); diff --git a/process_bug.cgi b/process_bug.cgi index 4fd9cc746..d81f866e5 100755 --- a/process_bug.cgi +++ b/process_bug.cgi @@ -1116,7 +1116,12 @@ foreach my $id (@idlist) { # change the component of a bug (we checked product above). # http://bugzilla.mozilla.org/show_bug.cgi?id=180545 my $product_id = get_product_id($::FORM{'product'}); - $::FORM{'component_id'} = get_component_id($product_id, $::FORM{'component'}); + + if ($::FORM{'component'} ne $::FORM{'dontchange'}) { + $::FORM{'component_id'} = + get_component_id($product_id, $::FORM{'component'}); + } + my $i = 0; foreach my $col (@::log_columns) { # Consider NULL db entries to be equivalent to the empty string @@ -1127,7 +1132,8 @@ foreach my $id (@idlist) { # More fun hacking... don't display component_id my $vars; if ($col eq 'component_id') { - $vars->{'oldvalue'} = get_component_name($oldhash{'component_id'}); + $vars->{'oldvalue'} = + get_component_name($oldhash{'component_id'}); $vars->{'newvalue'} = $::FORM{'component'}; $vars->{'field'} = 'component'; } -- cgit v1.2.3-24-g4f1b