Commit 71979bcb authored by gerv%gerv.net's avatar gerv%gerv.net

Bug 233645 - fix a number of 'undef' warnings which were killing performance for…

Bug 233645 - fix a number of 'undef' warnings which were killing performance for multiple bug change. Patch by gerv; r,a=justdave.
parent 085e1375
...@@ -305,7 +305,7 @@ if ($::FORM{'cmdtype'} eq "dorem") { ...@@ -305,7 +305,7 @@ if ($::FORM{'cmdtype'} eq "dorem") {
exit; exit;
} }
} }
elsif ($::FORM{'cmdtype'} eq "doit") { elsif (($::FORM{'cmdtype'} eq "doit") && $::FORM{'remtype'}) {
if ($::FORM{'remtype'} eq "asdefault") { if ($::FORM{'remtype'} eq "asdefault") {
confirm_login(); confirm_login();
my $userid = DBNameToIdAndCheck($::COOKIE{"Bugzilla_login"}); my $userid = DBNameToIdAndCheck($::COOKIE{"Bugzilla_login"});
......
...@@ -829,7 +829,7 @@ sub get_product_name { ...@@ -829,7 +829,7 @@ sub get_product_name {
sub get_component_id { sub get_component_id {
my ($prod_id, $comp) = @_; my ($prod_id, $comp) = @_;
return undef unless ($prod_id =~ /^\d+$/); return undef unless ($prod_id && ($prod_id =~ /^\d+$/));
PushGlobalSQLState(); PushGlobalSQLState();
SendSQL("SELECT id FROM components " . SendSQL("SELECT id FROM components " .
"WHERE product_id = $prod_id AND name = " . SqlQuote($comp)); "WHERE product_id = $prod_id AND name = " . SqlQuote($comp));
......
...@@ -1116,7 +1116,12 @@ foreach my $id (@idlist) { ...@@ -1116,7 +1116,12 @@ foreach my $id (@idlist) {
# change the component of a bug (we checked product above). # change the component of a bug (we checked product above).
# http://bugzilla.mozilla.org/show_bug.cgi?id=180545 # http://bugzilla.mozilla.org/show_bug.cgi?id=180545
my $product_id = get_product_id($::FORM{'product'}); 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; my $i = 0;
foreach my $col (@::log_columns) { foreach my $col (@::log_columns) {
# Consider NULL db entries to be equivalent to the empty string # Consider NULL db entries to be equivalent to the empty string
...@@ -1127,7 +1132,8 @@ foreach my $id (@idlist) { ...@@ -1127,7 +1132,8 @@ foreach my $id (@idlist) {
# More fun hacking... don't display component_id # More fun hacking... don't display component_id
my $vars; my $vars;
if ($col eq 'component_id') { 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->{'newvalue'} = $::FORM{'component'};
$vars->{'field'} = 'component'; $vars->{'field'} = 'component';
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment