]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 233645 - fix a number of 'undef' warnings which were killing performance for...
authorgerv%gerv.net <>
Sat, 14 Feb 2004 04:24:51 +0000 (04:24 +0000)
committergerv%gerv.net <>
Sat, 14 Feb 2004 04:24:51 +0000 (04:24 +0000)
buglist.cgi
globals.pl
process_bug.cgi

index c33ea6238bbab86662f67d2926b7363cb6579363..ab7373e06d99ff7e61ceba0bb4b25848001ff380 100755 (executable)
@@ -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"});
index 825c30af7835edac3f156117bd61bd2c0c1fd0ad..9c1b9a7ef40cb760636638f7a1f0c8e02665ca39 100644 (file)
@@ -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));
index 4fd9cc74641117ed8b346902a95c24b982166271..d81f866e581ffbbc1fb5b88e603e7cc31d7a4a66 100755 (executable)
@@ -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';
                 }