diff --git a/Bugzilla/Config.pm b/Bugzilla/Config.pm index 5639d8603a..b88ef1fc8e 100644 --- a/Bugzilla/Config.pm +++ b/Bugzilla/Config.pm @@ -109,13 +109,13 @@ sub update { { if ($old_value ne $new_value) { $dbh->do('UPDATE params SET value = ? WHERE name = ?', undef, $new_value, $key); - $changes{"$id:$key"} = [$old_value, $new_value]; + $changes{$key} = [$old_value, $new_value]; } } else { $dbh->do('INSERT INTO params (name, value) VALUES (?, ?)', undef, $key, $new_value); - $changes{"$id:$key"} = ['', $new_value]; + $changes{$key} = ['', $new_value]; } } @@ -132,10 +132,8 @@ sub update { # not the case here so we assign the 'id' variable each interation # to make audit_log think each is a separate instance of # Bugzilla::Config and each change is a separate transaction. - foreach my $item (keys %changes) { - my ($id, $key) = split /:/, $item; - $self->{id} = $id; - $self->audit_log({$key => [$changes{$item}->[0], $changes{$item}->[1]]}); + foreach my $key (keys %changes) { + $self->audit_log({$key => [$changes{$key}->[0], $changes{$key}->[1]]}); } } catch { @@ -301,7 +299,7 @@ sub migrate_params { } # Generate unique Duo integration secret key - if ($param->{duo_akey} eq '') { + if (!exists $param->{duo_akey} || $param->{duo_akey} eq '') { require Bugzilla::Util; $param->{duo_akey} = Bugzilla::Util::generate_random_password(40); } diff --git a/Bugzilla/DB/Schema/Mysql.pm b/Bugzilla/DB/Schema/Mysql.pm index 02526887df..28546f5ce7 100644 --- a/Bugzilla/DB/Schema/Mysql.pm +++ b/Bugzilla/DB/Schema/Mysql.pm @@ -155,7 +155,7 @@ sub _get_create_index_ddl { my $sql = "CREATE "; $sql .= "$index_type " - if ($index_type eq 'UNIQUE' || $index_type eq 'FULLTEXT'); + if ($index_type && ($index_type eq 'UNIQUE' || $index_type eq 'FULLTEXT')); $sql .= "INDEX " . $dbh->quote_identifier($index_name) . " ON " diff --git a/extensions/BMO/Extension.pm b/extensions/BMO/Extension.pm index 0f27499d64..b6bbcf7af5 100755 --- a/extensions/BMO/Extension.pm +++ b/extensions/BMO/Extension.pm @@ -410,7 +410,7 @@ sub parse_bounty_attachment_description { fixed_date => $+{fixed_date} // '', awarded_date => $+{awarded_date} // '', publish => $map{$+{publish} // 'false'}, - credit => [grep {$_} split(/\s*,\s*/, $+{credits})] + credit => [grep {$_} split(/\s*,\s*/, $+{credits} || '')] }; } diff --git a/t/hash-sig.t b/t/hash-sig.t index 0c08c18549..27f2259e06 100644 --- a/t/hash-sig.t +++ b/t/hash-sig.t @@ -12,7 +12,7 @@ use Bugzilla::Util qw(generate_random_password); use Bugzilla::Token qw(issue_hash_sig check_hash_sig); use Bugzilla::Localconfig; use Test2::V0; -use Test2::Mock qw(mock); +use Test2::Tools::Mock qw(mock); my $site_wide_secret = generate_random_password(256); my $Localconfig = mock 'Bugzilla::Localconfig' => ( diff --git a/t/mojo-example.t b/t/mojo-example.t index 2301ee800f..af6a2ecfb2 100644 --- a/t/mojo-example.t +++ b/t/mojo-example.t @@ -43,7 +43,7 @@ my $api_key = issue_api_key('api@mozilla.org')->api_key; my $t = Test::Mojo->new('Bugzilla::App'); # we ensure this file exists so the /__lbhearbeat__ test passes. -$t->app->home->child('__lbheartbeat__')->spurt('httpd OK'); +$t->app->home->child('__lbheartbeat__')->spew('httpd OK'); # Method chaining is used extensively. $t->get_ok('/__lbheartbeat__')->status_is(200)->content_is('httpd OK'); diff --git a/template/en/default/bug/process/bugmail.html.tmpl b/template/en/default/bug/process/bugmail.html.tmpl index f0cabae973..bdd98e9e4e 100644 --- a/template/en/default/bug/process/bugmail.html.tmpl +++ b/template/en/default/bug/process/bugmail.html.tmpl @@ -27,6 +27,8 @@ [% USE Bugzilla %] [% PROCESS global/variables.none.tmpl %] +[% recipient_count = 0 IF !recipient_count.defined %] + [% IF recipient_count > 1 %] Email sent to [% recipient_count FILTER none %] recipients. [% ELSIF recipient_count == 1 %]