From 1db60b740690e08d68dd25c41defeb926f9b802a Mon Sep 17 00:00:00 2001 From: Dylan William Hardison Date: Wed, 30 Jan 2019 20:34:54 -0500 Subject: Bug 981487 - change bugs_fulltext from myisam to innodb --- Bugzilla/Bug.pm | 15 ++++----------- Bugzilla/DB/Schema/Mysql.pm | 2 +- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index ebf00edf3..d4e022336 100644 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -838,13 +838,10 @@ sub create { Bugzilla::Hook::process('bug_end_of_create', {bug => $bug, timestamp => $timestamp,}); - $dbh->bz_commit_transaction(); - - # Because MySQL doesn't support transactions on the fulltext table, - # we do this after we've committed the transaction. That way we're - # sure we're inserting a good Bug ID. $bug->_sync_fulltext(new_bug => 1); + $dbh->bz_commit_transaction(); + return $bug; } @@ -1211,17 +1208,13 @@ sub update { delete $user->{bugs_ignored} if $bug_ignored_changed; } - $dbh->bz_commit_transaction(); - - # The only problem with this here is that update() is often called - # in the middle of a transaction, and if that transaction is rolled - # back, this change will *not* be rolled back. As we expect rollbacks - # to be extremely rare, that is OK for us. $self->_sync_fulltext( update_short_desc => $changes->{short_desc}, update_comments => $self->{added_comments} || $self->{comment_isprivate} ); + $dbh->bz_commit_transaction(); + # Remove obsolete internal variables. delete $self->{'_old_assigned_to'}; delete $self->{'_old_qa_contact'}; diff --git a/Bugzilla/DB/Schema/Mysql.pm b/Bugzilla/DB/Schema/Mysql.pm index fe2191486..b5bebad30 100644 --- a/Bugzilla/DB/Schema/Mysql.pm +++ b/Bugzilla/DB/Schema/Mysql.pm @@ -85,7 +85,7 @@ use constant REVERSE_MAPPING => { # as in their db-specific version, so no reverse mapping is needed. }; -use constant MYISAM_TABLES => qw(bugs_fulltext); +use constant MYISAM_TABLES => qw(); #------------------------------------------------------------------------------ sub _initialize { -- cgit v1.2.3-65-gdbad From 62bb8a5941cc69f8b994b591e8595d9585189749 Mon Sep 17 00:00:00 2001 From: Dylan William Hardison Date: Wed, 30 Jan 2019 20:38:37 -0500 Subject: update release notes --- template/en/default/pages/release-notes.html.tmpl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/template/en/default/pages/release-notes.html.tmpl b/template/en/default/pages/release-notes.html.tmpl index b89e3a61d..d1380b067 100644 --- a/template/en/default/pages/release-notes.html.tmpl +++ b/template/en/default/pages/release-notes.html.tmpl @@ -43,6 +43,15 @@

Updates in this 5.0.x Release

+

5.0.5

+ +

This release reformats the code according to the same conventions as the popular Mojolicious product and includes a .perltidyrc to do the same. +You may use whatever coding style you want, but all files commited to the repo must be reformatted according to those rules.

+ +

Additionally, we no longer follow the same release process as before. Releases will be more frequent.

+ +

As it is now 2019, the bugs_fulltext table is now InnoDB instead of MyISAM. This may cause upgrade headaches.

+

5.0.4

This release fixes one security issue. See the -- cgit v1.2.3-65-gdbad From 62d5637a4c96abbcde6f308421d676a0336d8e25 Mon Sep 17 00:00:00 2001 From: Sébastien Santoro Date: Wed, 30 Jan 2019 20:50:01 -0500 Subject: Bug 1497042 - Enclose table names in CREATE queries --- Bugzilla/DB/Schema/Mysql.pm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Bugzilla/DB/Schema/Mysql.pm b/Bugzilla/DB/Schema/Mysql.pm index b5bebad30..0af73cc8f 100644 --- a/Bugzilla/DB/Schema/Mysql.pm +++ b/Bugzilla/DB/Schema/Mysql.pm @@ -135,8 +135,12 @@ sub _get_create_table_ddl { my $charset = Bugzilla->dbh->bz_db_is_utf8 ? "CHARACTER SET utf8" : ''; my $type = grep($_ eq $table, MYISAM_TABLES) ? 'MYISAM' : 'InnoDB'; - return ( - $self->SUPER::_get_create_table_ddl($table) . " ENGINE = $type $charset"); + + my $ddl = $self->SUPER::_get_create_table_ddl($table); + $ddl =~ s/CREATE TABLE (.*) \(/CREATE TABLE `$1` (/; + $ddl .= " ENGINE = $type $charset"; + + return $ddl; } #eosub--_get_create_table_ddl @@ -151,7 +155,7 @@ sub _get_create_index_ddl { my $sql = "CREATE "; $sql .= "$index_type " if ($index_type eq 'UNIQUE' || $index_type eq 'FULLTEXT'); - $sql .= "INDEX \`$index_name\` ON $table_name \(" + $sql .= "INDEX \`$index_name\` ON \`$table_name\` \(" . join(", ", @$index_fields) . "\)"; return ($sql); -- cgit v1.2.3-65-gdbad From 9d2417c9dc8f3a6a1b608a1c2717a89408d304c3 Mon Sep 17 00:00:00 2001 From: Dylan William Hardison Date: Thu, 31 Jan 2019 19:10:06 -0500 Subject: add perl-fmt script --- contrib/perl-fmt | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 contrib/perl-fmt diff --git a/contrib/perl-fmt b/contrib/perl-fmt new file mode 100755 index 000000000..7ac47eeb8 --- /dev/null +++ b/contrib/perl-fmt @@ -0,0 +1,24 @@ +#!/usr/bin/env perl +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# +# This Source Code Form is "Incompatible With Secondary Licenses", as +# defined by the Mozilla Public License, v. 2.0. + +use 5.10.1; +use strict; +use warnings; + +use File::Basename qw(dirname); +use Cwd qw(realpath); +use File::Spec::Functions qw(catfile catdir); +use Env qw(@PATH @PERL5LIB); + +my $bugzilla_dir = realpath(catdir( dirname(__FILE__), '..' )); +unshift @PERL5LIB, catdir($bugzilla_dir, 'local', 'lib', 'perl5'); +unshift @PATH, catdir($bugzilla_dir, 'local', 'bin'); + +my $profile = catfile($bugzilla_dir, ".perltidyrc" ); +warn "formatting @ARGV\n"; +exec( perltidy => "--profile=$profile", '-nst', '-b', '-bext=/', '-conv', @ARGV ); -- cgit v1.2.3-65-gdbad From f91e240aac65936bc9dee0f926cd6f1021f48fe0 Mon Sep 17 00:00:00 2001 From: Perl Tidy Date: Thu, 31 Jan 2019 20:50:06 -0500 Subject: no bug - perltidy again, using the latest release blame jeff --- Bugzilla/Attachment.pm | 2 +- Bugzilla/Auth/Verify/DB.pm | 2 +- Bugzilla/Bug.pm | 34 +++++++++++++++---------------- Bugzilla/BugMail.pm | 8 ++++---- Bugzilla/BugUrl.pm | 4 ++-- Bugzilla/CGI.pm | 8 +++----- Bugzilla/Chart.pm | 4 ++-- Bugzilla/Comment.pm | 2 +- Bugzilla/Component.pm | 2 +- Bugzilla/Config/Common.pm | 6 +++--- Bugzilla/DB.pm | 8 ++++---- Bugzilla/DB/Mysql.pm | 14 ++++++------- Bugzilla/DB/Oracle.pm | 8 ++++---- Bugzilla/DB/Schema.pm | 12 +++++------ Bugzilla/DB/Schema/Mysql.pm | 2 +- Bugzilla/DB/Schema/Oracle.pm | 2 +- Bugzilla/DB/Schema/Sqlite.pm | 2 +- Bugzilla/DB/Sqlite.pm | 2 +- Bugzilla/Extension.pm | 4 ++-- Bugzilla/Field.pm | 2 +- Bugzilla/Field/Choice.pm | 2 +- Bugzilla/Flag.pm | 8 ++++---- Bugzilla/FlagType.pm | 4 ++-- Bugzilla/Group.pm | 2 +- Bugzilla/Hook.pm | 2 +- Bugzilla/Install/DB.pm | 25 ++++++++++------------- Bugzilla/Install/Filesystem.pm | 4 ++-- Bugzilla/Install/Requirements.pm | 10 ++++----- Bugzilla/Install/Util.pm | 2 +- Bugzilla/Job/Mailer.pm | 2 +- Bugzilla/JobQueue/Runner.pm | 4 ++-- Bugzilla/Migrate.pm | 2 +- Bugzilla/Migrate/Gnats.pm | 2 +- Bugzilla/Milestone.pm | 2 +- Bugzilla/Object.pm | 8 ++++---- Bugzilla/Product.pm | 6 +++--- Bugzilla/Search.pm | 28 ++++++++++++------------- Bugzilla/Search/Quicksearch.pm | 12 +++++------ Bugzilla/Search/Saved.pm | 6 +++--- Bugzilla/Series.pm | 2 +- Bugzilla/Template.pm | 10 ++++----- Bugzilla/User.pm | 34 ++++++++++++++----------------- Bugzilla/User/Setting.pm | 10 ++++----- Bugzilla/Util.pm | 10 ++++----- Bugzilla/Version.pm | 2 +- Bugzilla/WebService/Bug.pm | 10 ++++----- Bugzilla/WebService/Bugzilla.pm | 2 +- Bugzilla/WebService/Server/JSONRPC.pm | 2 +- Bugzilla/WebService/Server/REST.pm | 6 +++--- Bugzilla/WebService/Server/XMLRPC.pm | 2 +- attachment.cgi | 4 ++-- buglist.cgi | 8 ++++---- chart.cgi | 2 +- checksetup.pl | 2 +- colchange.cgi | 2 +- collectstats.pl | 8 ++++---- contrib/bzdbcopy.pl | 2 +- contrib/console.pl | 2 +- contrib/extension-convert.pl | 4 ++-- contrib/merge-users.pl | 4 ++-- contrib/recode.pl | 6 +++--- docs/lib/Pod/Simple/HTMLBatch/Bugzilla.pm | 2 +- editfields.cgi | 2 +- editgroups.cgi | 2 +- editmilestones.cgi | 2 +- editproducts.cgi | 6 +++--- editsettings.cgi | 2 +- editvalues.cgi | 2 +- editwhines.cgi | 4 ++-- editworkflow.cgi | 2 +- email_in.pl | 4 ++-- enter_bug.cgi | 2 +- extensions/BmpConvert/Extension.pm | 2 +- extensions/Example/Extension.pm | 2 +- extensions/MoreBugUrl/Extension.pm | 3 +-- extensions/OldBugMove/Extension.pm | 2 +- extensions/Voting/Extension.pm | 6 +++--- importxml.pl | 4 ++-- post_bug.cgi | 2 +- quips.cgi | 2 +- relogin.cgi | 2 +- report.cgi | 2 +- reports.cgi | 10 ++++----- request.cgi | 2 +- sanitycheck.cgi | 23 ++++++++------------- show_bug.cgi | 2 +- showdependencygraph.cgi | 8 +++----- showdependencytree.cgi | 4 ++-- summarize_time.cgi | 2 +- t/001compile.t | 2 +- t/002goodperl.t | 2 +- t/012throwables.t | 2 +- testserver.pl | 8 ++++---- userprefs.cgi | 4 ++-- votes.cgi | 2 +- whine.pl | 6 +++--- xt/lib/Bugzilla/Test/Search.pm | 20 ++++++++---------- xt/lib/Bugzilla/Test/Search/Constants.pm | 6 ++---- xt/lib/Bugzilla/Test/Search/CustomTest.pm | 2 +- xt/lib/Bugzilla/Test/Search/FieldTest.pm | 10 ++++----- xt/lib/Bugzilla/Test/Search/OrTest.pm | 2 +- 101 files changed, 269 insertions(+), 298 deletions(-) diff --git a/Bugzilla/Attachment.pm b/Bugzilla/Attachment.pm index 326534dd8..26f768c2f 100644 --- a/Bugzilla/Attachment.pm +++ b/Bugzilla/Attachment.pm @@ -76,7 +76,7 @@ use constant DB_COLUMNS => qw( submitter_id ); -use constant REQUIRED_FIELD_MAP => {bug_id => 'bug',}; +use constant REQUIRED_FIELD_MAP => {bug_id => 'bug',}; use constant EXTRA_REQUIRED_FIELDS => qw(data); use constant UPDATE_COLUMNS => qw( diff --git a/Bugzilla/Auth/Verify/DB.pm b/Bugzilla/Auth/Verify/DB.pm index 951aaaf9f..6ed9ba15c 100644 --- a/Bugzilla/Auth/Verify/DB.pm +++ b/Bugzilla/Auth/Verify/DB.pm @@ -23,7 +23,7 @@ sub check_credentials { my $dbh = Bugzilla->dbh; my $username = $login_data->{username}; - my $user = new Bugzilla::User({name => $username}); + my $user = new Bugzilla::User({name => $username}); return {failure => AUTH_NO_SUCH_USER} unless $user; diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index d4e022336..bce3661f1 100644 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -208,7 +208,7 @@ sub UPDATE_COLUMNS { my @custom = grep { $_->type != FIELD_TYPE_MULTI_SELECT } Bugzilla->active_custom_fields; my @custom_names = map { $_->name } @custom; - my @columns = qw( + my @columns = qw( assigned_to bug_file_loc bug_severity @@ -313,10 +313,10 @@ sub new { # make it the "name" param. if ( !defined $param || (!ref($param) && $param !~ /^[0-9]+$/) - || (ref($param) && $param->{id} !~ /^[0-9]+$/)) + || (ref($param) && $param->{id} !~ /^[0-9]+$/)) { if ($param) { - my $alias = ref($param) ? $param->{id} : $param; + my $alias = ref($param) ? $param->{id} : $param; my $bug_id = bug_alias_to_id($alias); if (!$bug_id) { my $error_self = {}; @@ -365,7 +365,7 @@ sub initialize { sub object_cache_key { my $class = shift; - my $key = $class->SUPER::object_cache_key(@_) || return; + my $key = $class->SUPER::object_cache_key(@_) || return; return $key . ',' . Bugzilla->user->id; } @@ -467,7 +467,7 @@ sub match { # so include them in the list if they have been specified. if (exists $params->{"${field}_id"}) { my $current_ids = $params->{"${field}_id"}; - my @id_array = ref $current_ids ? @$current_ids : ($current_ids); + my @id_array = ref $current_ids ? @$current_ids : ($current_ids); push(@ids, @id_array); } @@ -556,7 +556,7 @@ sub _extract_bug_ids { push @bug_ids, $comment->extra_data; next; } - my $s = $comment->already_wrapped ? qr/\s/ : qr/\h/; + my $s = $comment->already_wrapped ? qr/\s/ : qr/\h/; my $text = $comment->body; # Full bug links @@ -803,7 +803,7 @@ sub create { if ($see_also) { my $see_also_array = $see_also; if (!ref $see_also_array) { - $see_also = trim($see_also); + $see_also = trim($see_also); $see_also_array = [split(/[\s,]+/, $see_also)]; } foreach my $value (@$see_also_array) { @@ -1893,7 +1893,7 @@ sub _check_keywords { my $keyword_array = $keywords_in; if (!ref $keyword_array) { - $keywords_in = trim($keywords_in); + $keywords_in = trim($keywords_in); $keyword_array = [split(/[\s,]+/, $keywords_in)]; } @@ -1956,7 +1956,7 @@ sub _check_qa_contact { my $id; if ($qa_contact) { $qa_contact = Bugzilla::User->check($qa_contact) if !ref $qa_contact; - $id = $qa_contact->id; + $id = $qa_contact->id; # create() checks this another way, so we don't have to run this # check during create(). @@ -2017,7 +2017,7 @@ sub _check_resolution { && scalar @$dependson ) { - my $dep_bugs = Bugzilla::Bug->new_from_list($dependson); + my $dep_bugs = Bugzilla::Bug->new_from_list($dependson); my $count_open = grep { $_->isopened } @$dep_bugs; if ($count_open) { my $bug_id = ref($invocant) ? $invocant->id : undef; @@ -2641,7 +2641,7 @@ sub set_dependencies { my ($self, $dependson, $blocked) = @_; my %extra = (blocked => $blocked); $dependson = $self->_check_dependencies($dependson, 'dependson', \%extra); - $blocked = $extra{blocked}; + $blocked = $extra{blocked}; # These may already be detainted, but all setters are supposed to # detaint their input if they've run a validator (just as though @@ -3051,7 +3051,7 @@ sub add_comment { $params ||= {}; # Fill out info that doesn't change and callers may not pass in - $params->{'bug_id'} = $self; + $params->{'bug_id'} = $self; $params->{'thetext'} = defined($comment) ? $comment : ''; # Validate all the entered data @@ -3139,7 +3139,7 @@ sub add_group { # So we have to store and pass the name as entered by the user to # the error message, if we have it. my $group_name = blessed($group) ? $group->name : $group; - my $args = { + my $args = { name => $group_name, product => $self->product, bug_id => $self->id, @@ -3175,7 +3175,7 @@ sub remove_group { # See add_group() for the reason why we store the user input. my $group_name = blessed($group) ? $group->name : $group; - my $args = { + my $args = { name => $group_name, product => $self->product, bug_id => $self->id, @@ -4443,7 +4443,7 @@ sub LogActivityEntry { if (length($removestr) > MAX_LINE_LENGTH) { my $commaposition = find_wrap_point($removed, MAX_LINE_LENGTH); $removestr = substr($removed, 0, $commaposition); - $removed = substr($removed, $commaposition); + $removed = substr($removed, $commaposition); } else { $removed = ""; # no more entries @@ -4451,7 +4451,7 @@ sub LogActivityEntry { if (length($addstr) > MAX_LINE_LENGTH) { my $commaposition = find_wrap_point($added, MAX_LINE_LENGTH); $addstr = substr($added, 0, $commaposition); - $added = substr($added, $commaposition); + $added = substr($added, $commaposition); } else { $added = ""; # no more entries @@ -4758,7 +4758,7 @@ sub ValidateDependencies { @{$deps{$target}} = @{$deptree{$target}}; my @stack = @{$deps{$target}}; while (@stack) { - my $i = shift @stack; + my $i = shift @stack; my $dep_list = $dbh->selectcol_arrayref($sth{$target}, undef, $i); foreach my $t (@$dep_list) { diff --git a/Bugzilla/BugMail.pm b/Bugzilla/BugMail.pm index 90eed0d8e..18795d735 100644 --- a/Bugzilla/BugMail.pm +++ b/Bugzilla/BugMail.pm @@ -59,7 +59,7 @@ sub Send { # Bugzilla::User objects of people in various roles. More than one person # can 'have' a role, if the person in that role has changed, or people are # watching. - my @assignees = ($bug->assigned_to); + my @assignees = ($bug->assigned_to); my @qa_contacts = $bug->qa_contact || (); my @ccs = @{$bug->cc_users}; @@ -455,7 +455,7 @@ sub _flatten_object { # the same objects are used for each recipient, so cache the flattened hash my $cache = Bugzilla->request_cache->{bugmail_flat_objects} ||= {}; - my $key = blessed($object) . '-' . $object->id; + my $key = blessed($object) . '-' . $object->id; return $cache->{$key} ||= $object->flatten_to_hash; } @@ -559,7 +559,7 @@ sub _get_diffs { && $diff->{field_name} eq $changes[-1]->{field_name} && $diff->{bug_when} eq $changes[-1]->{bug_when} && $diff->{who} eq $changes[-1]->{who} - && ($diff->{attach_id} // 0) == ($changes[-1]->{attach_id} // 0) + && ($diff->{attach_id} // 0) == ($changes[-1]->{attach_id} // 0) && ($diff->{comment_id} // 0) == ($changes[-1]->{comment_id} // 0)) { my $old_change = pop @changes; @@ -575,7 +575,7 @@ sub _get_diffs { } sub _get_new_bugmail_fields { - my $bug = shift; + my $bug = shift; my @fields = @{Bugzilla->fields({obsolete => 0, in_new_bugmail => 1})}; my @diffs; my $params = Bugzilla->params; diff --git a/Bugzilla/BugUrl.pm b/Bugzilla/BugUrl.pm index 255be8623..c3e11e4c7 100644 --- a/Bugzilla/BugUrl.pm +++ b/Bugzilla/BugUrl.pm @@ -83,7 +83,7 @@ sub new { if (ref $param) { my $bug_id = $param->{bug_id}; - my $name = $param->{name} || $param->{value}; + my $name = $param->{name} || $param->{value}; if (!defined $bug_id) { ThrowCodeError('bad_arg', {argument => 'bug_id', function => "${class}::new"}); } @@ -92,7 +92,7 @@ sub new { } my $condition = 'bug_id = ? AND value = ?'; - my @values = ($bug_id, $name); + my @values = ($bug_id, $name); $param = {condition => $condition, values => \@values}; } diff --git a/Bugzilla/CGI.pm b/Bugzilla/CGI.pm index a4319be07..019fb8d10 100644 --- a/Bugzilla/CGI.pm +++ b/Bugzilla/CGI.pm @@ -35,10 +35,8 @@ sub _init_bz_cgi_globals { # We don't precompile any functions here, that's done specially in # mod_perl code. - $invocant->_setup_symbols( - qw(:no_xhtml :oldstyle_urls :private_tempfiles - :unique_headers) - ); + $invocant->_setup_symbols(qw(:no_xhtml :oldstyle_urls :private_tempfiles + :unique_headers)); } BEGIN { __PACKAGE__->_init_bz_cgi_globals() if i_am_cgi(); } @@ -357,7 +355,7 @@ sub _prevent_unsafe_response { my $is_safe_content_type = $content_type =~ $safe_content_type_re; # Safe referers are ones that begin with the urlbase. - my $referer = $self->referer; + my $referer = $self->referer; my $is_safe_referer = $referer && $referer =~ $safe_referer_re; if (!$is_safe_referer && !$is_safe_content_type) { diff --git a/Bugzilla/Chart.pm b/Bugzilla/Chart.pm index 3aee1aafb..1abf3dbe4 100644 --- a/Bugzilla/Chart.pm +++ b/Bugzilla/Chart.pm @@ -27,7 +27,7 @@ use List::Util qw(max); sub new { my $invocant = shift; - my $class = ref($invocant) || $invocant; + my $class = ref($invocant) || $invocant; # Create a ref to an empty hash and bless it my $self = {}; @@ -255,7 +255,7 @@ sub readData { my $sth = $dbh->prepare($query); - my $gt_index = $self->{'gt'} ? scalar(@{$self->{'lines'}}) : undef; + my $gt_index = $self->{'gt'} ? scalar(@{$self->{'lines'}}) : undef; my $line_index = 0; $maxvals[$gt_index] = 0 if $gt_index; diff --git a/Bugzilla/Comment.pm b/Bugzilla/Comment.pm index 02a044ff5..575703b4b 100644 --- a/Bugzilla/Comment.pm +++ b/Bugzilla/Comment.pm @@ -305,7 +305,7 @@ sub remove_tag { my ($self, $tag) = @_; $tag = $self->_check_tag($tag); - my $tags = $self->tags; + my $tags = $self->tags; my $index = first { lc($tags->[$_]) eq lc($tag) } 0 .. scalar(@$tags) - 1; return unless defined $index; splice(@$tags, $index, 1); diff --git a/Bugzilla/Component.pm b/Bugzilla/Component.pm index 3cdee9d63..ef8180eb0 100644 --- a/Bugzilla/Component.pm +++ b/Bugzilla/Component.pm @@ -83,7 +83,7 @@ sub new { } my $condition = 'product_id = ? AND name = ?'; - my @values = ($product->id, $name); + my @values = ($product->id, $name); $param = {condition => $condition, values => \@values}; } diff --git a/Bugzilla/Config/Common.pm b/Bugzilla/Config/Common.pm index 756dbb0dd..a0077b5b2 100644 --- a/Bugzilla/Config/Common.pm +++ b/Bugzilla/Config/Common.pm @@ -104,7 +104,7 @@ sub check_sslbase { my $proto = getprotobyname('tcp'); socket(SOCK, PF_INET, SOCK_STREAM, $proto); my $iaddr = inet_aton($host) || return "The host $host cannot be resolved"; - my $sin = sockaddr_in($port, $iaddr); + my $sin = sockaddr_in($port, $iaddr); if (!connect(SOCK, $sin)) { return "Failed to connect to $host:$port ($!); unable to enable SSL"; } @@ -115,7 +115,7 @@ sub check_sslbase { sub check_ip { my $inbound_proxies = shift; - my @proxies = split(/[\s,]+/, $inbound_proxies); + my @proxies = split(/[\s,]+/, $inbound_proxies); foreach my $proxy (@proxies) { validate_ip($proxy) || return "$proxy is not a valid IPv4 or IPv6 address"; } @@ -176,7 +176,7 @@ sub check_opsys { } sub check_bug_status { - my $bug_status = shift; + my $bug_status = shift; my @closed_bug_statuses = map { $_->name } closed_bug_statuses(); if (!grep($_ eq $bug_status, @closed_bug_statuses)) { return "Must be a valid closed status: one of " diff --git a/Bugzilla/DB.pm b/Bugzilla/DB.pm index 029e05f03..c528e77d1 100644 --- a/Bugzilla/DB.pm +++ b/Bugzilla/DB.pm @@ -202,7 +202,7 @@ sub bz_check_server_version { my $sql_vers = $self->bz_server_version; $self->disconnect; - my $sql_want = $db->{db_version}; + my $sql_want = $db->{db_version}; my $version_ok = vers_cmp($sql_vers, $sql_want) > -1 ? 1 : 0; my $sql_server = $db->{name}; @@ -238,7 +238,7 @@ sub bz_create_database { # See if we can connect to the actual Bugzilla database. my $conn_success = eval { $dbh = connect_main() }; - my $db_name = Bugzilla->localconfig->{db_name}; + my $db_name = Bugzilla->localconfig->{db_name}; if (!$conn_success) { $dbh = _get_no_db_connection(); @@ -1136,7 +1136,7 @@ sub _bz_schema { my ($self) = @_; return $self->{private_bz_schema} if exists $self->{private_bz_schema}; my @module_parts = split('::', ref $self); - my $module_name = pop @module_parts; + my $module_name = pop @module_parts; $self->{private_bz_schema} = Bugzilla::DB::Schema->new($module_name); return $self->{private_bz_schema}; } @@ -1499,7 +1499,7 @@ sub _bz_populate_enum_table { my $insert = $self->prepare("INSERT INTO $sql_table (value,sortkey) VALUES (?,?)"); my $sortorder = 0; - my $maxlen = max(map(length($_), @$valuelist)) + 2; + my $maxlen = max(map(length($_), @$valuelist)) + 2; foreach my $value (@$valuelist) { $sortorder += 100; $insert->execute($value, $sortorder); diff --git a/Bugzilla/DB/Mysql.pm b/Bugzilla/DB/Mysql.pm index 96a1fcb21..a58d88df4 100644 --- a/Bugzilla/DB/Mysql.pm +++ b/Bugzilla/DB/Mysql.pm @@ -283,7 +283,7 @@ sub bz_explain { $i++; } - my $first_row = sprintf($format_string, @$columns); + my $first_row = sprintf($format_string, @$columns); my @explain_rows = ($first_row, '-' x length($first_row)); while (my $row = $sth->fetchrow_arrayref) { my @fixed = map { defined $_ ? $_ : 'NULL' } @$row; @@ -328,7 +328,7 @@ sub bz_setup_database { # This parameter is not yet defined when the DB is being built for # the very first time. The code below still works properly, however, # because the default maxattachmentsize is smaller than $min_max_allowed. - my $max_attachment = (Bugzilla->params->{'maxattachmentsize'} || 0) * 1024; + my $max_attachment = (Bugzilla->params->{'maxattachmentsize'} || 0) * 1024; my $needed_max_allowed = max($min_max_allowed, $max_attachment); if ($current_max_allowed < $needed_max_allowed) { warn install_string('max_allowed_packet', @@ -737,7 +737,7 @@ sub bz_setup_database { my ($binary, $utf8) = ($sql_def, $sql_def); my $type = $self->_bz_schema->convert_type($col_info->{TYPE}); $binary =~ s/(\Q$type\E)/$1 CHARACTER SET binary/; - $utf8 =~ s/(\Q$type\E)/$1 CHARACTER SET utf8/; + $utf8 =~ s/(\Q$type\E)/$1 CHARACTER SET utf8/; push(@binary_sql, "MODIFY COLUMN $name $binary"); push(@utf8_sql, "MODIFY COLUMN $name $utf8"); } @@ -809,13 +809,13 @@ sub bz_setup_database { # looks like. So we remove defaults from columns that aren't supposed # to have them sub _fix_defaults { - my $self = shift; + my $self = shift; my $maj_version = substr($self->bz_server_version, 0, 1); return if $maj_version < 5; # The oldest column that could have this problem is bugs.assigned_to, # so if it doesn't have the problem, we just skip doing this entirely. - my $assi_def = $self->_bz_raw_column_info('bugs', 'assigned_to'); + my $assi_def = $self->_bz_raw_column_info('bugs', 'assigned_to'); my $assi_default = $assi_def->{COLUMN_DEF}; # This "ne ''" thing is necessary because _raw_column_info seems to @@ -834,7 +834,7 @@ sub _fix_defaults { # Get the exact default from the database without any # "fixing" by bz_column_info_real. - my $raw_info = $self->_bz_raw_column_info($table, $column); + my $raw_info = $self->_bz_raw_column_info($table, $column); my $raw_default = $raw_info->{COLUMN_DEF}; if (defined $raw_default) { if ($raw_default eq '') { @@ -856,7 +856,7 @@ sub _fix_defaults { print "Fixing defaults...\n"; foreach my $table (reverse sort keys %fix_columns) { my @alters = map("ALTER COLUMN $_ DROP DEFAULT", @{$fix_columns{$table}}); - my $sql = "ALTER TABLE $table " . join(',', @alters); + my $sql = "ALTER TABLE $table " . join(',', @alters); $self->do($sql); } } diff --git a/Bugzilla/DB/Oracle.pm b/Bugzilla/DB/Oracle.pm index 337a0b5ba..930270ccc 100644 --- a/Bugzilla/DB/Oracle.pm +++ b/Bugzilla/DB/Oracle.pm @@ -310,7 +310,7 @@ sub adjust_statement { # Oracle requires a FROM clause in all SELECT statements, so append # "FROM dual" to queries without one (e.g., "SELECT NOW()") my $is_select = ($part =~ m/^\s*SELECT\b/io); - my $has_from = ($part =~ m/\bFROM\b/io) if $is_select; + my $has_from = ($part =~ m/\bFROM\b/io) if $is_select; # Oracle includes the time in CURRENT_DATE. $part =~ s/\bCURRENT_DATE\b/TRUNC(CURRENT_DATE)/io; @@ -669,7 +669,7 @@ sub bz_setup_database { # triggers ourselves. if ($def->{TYPE} =~ /SERIAL/i) { my $sequence = "${table}_${column}_SEQ"; - my $exists = $self->selectrow_array($sth, undef, $sequence); + my $exists = $self->selectrow_array($sth, undef, $sequence); if (!$exists) { my @sql = $self->_get_create_seq_ddl($table, $column); $self->do($_) foreach @sql; @@ -688,7 +688,7 @@ sub bz_setup_database { $to_table = 'tag'; } if ($update =~ /CASCADE/i) { - my $trigger_name = uc($fk_name . "_UC"); + my $trigger_name = uc($fk_name . "_UC"); my $exist_trigger = $self->selectcol_arrayref($sth, undef, $trigger_name); if (@$exist_trigger) { $self->do("DROP TRIGGER $trigger_name"); @@ -713,7 +713,7 @@ sub bz_setup_database { } # Drop the trigger which causes bug 541553 - my $trigger_name = "PRODUCTS_MILESTONEURL"; + my $trigger_name = "PRODUCTS_MILESTONEURL"; my $exist_trigger = $self->selectcol_arrayref($sth, undef, $trigger_name); if (@$exist_trigger) { $self->do("DROP TRIGGER $trigger_name"); diff --git a/Bugzilla/DB/Schema.pm b/Bugzilla/DB/Schema.pm index 4fc9ce8e2..0ca4a386f 100644 --- a/Bugzilla/DB/Schema.pm +++ b/Bugzilla/DB/Schema.pm @@ -2048,7 +2048,7 @@ sub _column_fks_to_ddl { my ($self, $table, $column_fks) = @_; my @ddl; foreach my $column (keys %$column_fks) { - my $def = $column_fks->{$column}; + my $def = $column_fks->{$column}; my $fk_string = $self->get_fk_ddl($table, $column, $def); push(@ddl, $fk_string); } @@ -2147,7 +2147,7 @@ sub get_table_columns { sub get_table_indexes_abstract { my ($self, $table) = @_; my $table_def = $self->get_table_abstract($table); - my %indexes = @{$table_def->{INDEXES} || []}; + my %indexes = @{$table_def->{INDEXES} || []}; return \%indexes; } @@ -2217,7 +2217,7 @@ sub _get_create_table_ddl { my $finfo = shift(@fields); push(@col_lines, "\t$field\t" . $self->get_type_ddl($finfo)); if ($self->FK_ON_CREATE and $finfo->{REFERENCES}) { - my $fk = $finfo->{REFERENCES}; + my $fk = $finfo->{REFERENCES}; my $fk_ddl = $self->get_fk_ddl($table, $field, $fk); push(@fk_lines, $fk_ddl); } @@ -2352,7 +2352,7 @@ sub get_alter_column_ddl { my ($table, $column, $new_def, $set_nulls_to) = @_; my @statements; - my $old_def = $self->get_column_abstract($table, $column); + my $old_def = $self->get_column_abstract($table, $column); my $specific = $self->{db_specific}; # If the types have changed, we have to deal with that. @@ -2711,7 +2711,7 @@ sub delete_column { my ($self, $table, $column) = @_; my $abstract_fields = $self->{abstract_schema}{$table}{FIELDS}; - my $name_position = firstidx { $_ eq $column } @$abstract_fields; + my $name_position = firstidx { $_ eq $column } @$abstract_fields; die "Attempted to delete nonexistent column ${table}.${column}" if $name_position == -1; @@ -2859,7 +2859,7 @@ sub _set_object { sub delete_index { my ($self, $table, $name) = @_; - my $indexes = $self->{abstract_schema}{$table}{INDEXES}; + my $indexes = $self->{abstract_schema}{$table}{INDEXES}; my $name_position = firstidx { $_ eq $name } @$indexes; die "Attempted to delete nonexistent index $name on the $table table" if $name_position == -1; diff --git a/Bugzilla/DB/Schema/Mysql.pm b/Bugzilla/DB/Schema/Mysql.pm index 0af73cc8f..4c0d43523 100644 --- a/Bugzilla/DB/Schema/Mysql.pm +++ b/Bugzilla/DB/Schema/Mysql.pm @@ -178,7 +178,7 @@ sub get_create_database_sql { # MySQL has a simpler ALTER TABLE syntax than ANSI. sub get_alter_column_ddl { my ($self, $table, $column, $new_def, $set_nulls_to) = @_; - my $old_def = $self->get_column($table, $column); + my $old_def = $self->get_column($table, $column); my %new_def_copy = %$new_def; if ($old_def->{PRIMARYKEY} && $new_def->{PRIMARYKEY}) { diff --git a/Bugzilla/DB/Schema/Oracle.pm b/Bugzilla/DB/Schema/Oracle.pm index 0cf2b6c4b..416e9204b 100644 --- a/Bugzilla/DB/Schema/Oracle.pm +++ b/Bugzilla/DB/Schema/Oracle.pm @@ -228,7 +228,7 @@ sub get_alter_column_ddl { my ($self, $table, $column, $new_def, $set_nulls_to) = @_; my @statements; - my $old_def = $self->get_column_abstract($table, $column); + my $old_def = $self->get_column_abstract($table, $column); my $specific = $self->{db_specific}; # If the types have changed, we have to deal with that. diff --git a/Bugzilla/DB/Schema/Sqlite.pm b/Bugzilla/DB/Schema/Sqlite.pm index 73ee7cfc5..57361d2bb 100644 --- a/Bugzilla/DB/Schema/Sqlite.pm +++ b/Bugzilla/DB/Schema/Sqlite.pm @@ -288,7 +288,7 @@ sub get_rename_column_ddl { sub get_add_fks_sql { my ($self, $table, $column_fks) = @_; my @clauses = $self->_sqlite_table_lines($table); - my @add = $self->_column_fks_to_ddl($table, $column_fks); + my @add = $self->_column_fks_to_ddl($table, $column_fks); push(@clauses, @add); return $self->_sqlite_alter_schema($table, \@clauses); } diff --git a/Bugzilla/DB/Sqlite.pm b/Bugzilla/DB/Sqlite.pm index 68180414c..c180fd0d7 100644 --- a/Bugzilla/DB/Sqlite.pm +++ b/Bugzilla/DB/Sqlite.pm @@ -250,7 +250,7 @@ sub bz_setup_database { # If we created TheSchwartz tables with COLLATE bugzilla (during the # 4.1.x development series) re-create them without it. - my @tables = $self->bz_table_list(); + my @tables = $self->bz_table_list(); my @ts_tables = grep {/^ts_/} @tables; my $drop_ok; foreach my $table (@ts_tables) { diff --git a/Bugzilla/Extension.pm b/Bugzilla/Extension.pm index 746fc4bfd..a5522583e 100644 --- a/Bugzilla/Extension.pm +++ b/Bugzilla/Extension.pm @@ -155,7 +155,7 @@ sub my_inc { # a "require" on Windows, for example.) return if $file !~ /^Bugzilla/; - my $lib_dir = __do_call($class, 'lib_dir'); + my $lib_dir = __do_call($class, 'lib_dir'); my @class_parts = split('::', $class); my ($vol, $dir, $file_name) = File::Spec->splitpath($file); my @dir_parts = File::Spec->splitdir($dir); @@ -190,7 +190,7 @@ sub my_inc { use constant enabled => 1; sub lib_dir { - my $invocant = shift; + my $invocant = shift; my $package_dir = __do_call($invocant, 'package_dir'); # For extensions that are just files in the extensions/ directory, diff --git a/Bugzilla/Field.pm b/Bugzilla/Field.pm index 4a364eb3a..97013af51 100644 --- a/Bugzilla/Field.pm +++ b/Bugzilla/Field.pm @@ -153,7 +153,7 @@ use constant SQL_DEFINITIONS => { {TYPE => 'varchar(64)', NOTNULL => 1, DEFAULT => "'---'"}, FIELD_TYPE_TEXTAREA, {TYPE => 'MEDIUMTEXT', NOTNULL => 1, DEFAULT => "''"}, FIELD_TYPE_DATETIME, {TYPE => 'DATETIME'}, FIELD_TYPE_DATE, {TYPE => 'DATE'}, FIELD_TYPE_BUG_ID, - {TYPE => 'INT3'}, FIELD_TYPE_INTEGER, + {TYPE => 'INT3'}, FIELD_TYPE_INTEGER, {TYPE => 'INT4', NOTNULL => 1, DEFAULT => 0}, }; diff --git a/Bugzilla/Field/Choice.pm b/Bugzilla/Field/Choice.pm index 360f851aa..bd82a8e3f 100644 --- a/Bugzilla/Field/Choice.pm +++ b/Bugzilla/Field/Choice.pm @@ -77,7 +77,7 @@ use constant DEFAULT_MAP => { sub type { my ($class, $field) = @_; - my $field_obj = blessed $field ? $field : Bugzilla::Field->check($field); + my $field_obj = blessed $field ? $field : Bugzilla::Field->check($field); my $field_name = $field_obj->name; if (my $package = $class->CLASS_MAP->{$field_name}) { diff --git a/Bugzilla/Flag.pm b/Bugzilla/Flag.pm index f0f5856cf..fb43d306b 100644 --- a/Bugzilla/Flag.pm +++ b/Bugzilla/Flag.pm @@ -450,7 +450,7 @@ sub create { my ($class, $flag, $timestamp) = @_; $timestamp ||= Bugzilla->dbh->selectrow_array('SELECT LOCALTIMESTAMP(0)'); - my $params = {}; + my $params = {}; my @columns = grep { $_ ne 'id' } $class->_get_db_columns; # Some columns use date formatting so use alias instead @@ -513,7 +513,7 @@ sub update_flags { my ($class, $self, $old_self, $timestamp) = @_; my @old_summaries = $class->snapshot($old_self->flags); - my %old_flags = map { $_->id => $_ } @{$old_self->flags}; + my %old_flags = map { $_->id => $_ } @{$old_self->flags}; foreach my $new_flag (@{$self->flags}) { if (!$new_flag->id) { @@ -549,7 +549,7 @@ sub update_flags { } my @new_summaries = $class->snapshot($self->flags); - my @changes = $class->update_activity(\@old_summaries, \@new_summaries); + my @changes = $class->update_activity(\@old_summaries, \@new_summaries); Bugzilla::Hook::process( 'flag_end_of_update', @@ -628,7 +628,7 @@ sub force_retarget { foreach my $flag (@$flags) { # $bug is undefined when e.g. editing inclusion and exclusion lists. - my $obj = $flag->attachment || $bug || $flag->bug; + my $obj = $flag->attachment || $bug || $flag->bug; my $is_retargetted = $flag->retarget($obj); if ($is_retargetted) { $dbh->do('UPDATE flags SET type_id = ? WHERE id = ?', diff --git a/Bugzilla/FlagType.pm b/Bugzilla/FlagType.pm index 78123d548..a08ee83b9 100644 --- a/Bugzilla/FlagType.pm +++ b/Bugzilla/FlagType.pm @@ -615,7 +615,7 @@ sub match { my $dbh = Bugzilla->dbh; # Depending on the criteria, we may have to append additional tables. - my $tables = [DB_TABLE]; + my $tables = [DB_TABLE]; my @criteria = sqlify_criteria($criteria, $tables); $tables = join(' ', @$tables); $criteria = join(' AND ', @criteria); @@ -643,7 +643,7 @@ sub count { my $dbh = Bugzilla->dbh; # Depending on the criteria, we may have to append additional tables. - my $tables = [DB_TABLE]; + my $tables = [DB_TABLE]; my @criteria = sqlify_criteria($criteria, $tables); $tables = join(' ', @$tables); $criteria = join(' AND ', @criteria); diff --git a/Bugzilla/Group.pm b/Bugzilla/Group.pm index 157f8cd32..8715c4cfe 100644 --- a/Bugzilla/Group.pm +++ b/Bugzilla/Group.pm @@ -180,7 +180,7 @@ sub check_members_are_visible { my $user = Bugzilla->user; return if !Bugzilla->params->{'usevisibilitygroups'}; - my $group_id = $self->id; + my $group_id = $self->id; my $is_visible = grep { $_ == $group_id } @{$user->visible_groups_inherited}; if (!$is_visible) { ThrowUserError('group_not_visible', {group => $self}); diff --git a/Bugzilla/Hook.pm b/Bugzilla/Hook.pm index 3575d30c1..f5c67c692 100644 --- a/Bugzilla/Hook.pm +++ b/Bugzilla/Hook.pm @@ -26,7 +26,7 @@ sub process { } sub in { - my $hook_name = shift; + my $hook_name = shift; my $currently_in = Bugzilla->request_cache->{hook_stack}->[-1] || ''; return $hook_name eq $currently_in ? 1 : 0; } diff --git a/Bugzilla/Install/DB.pm b/Bugzilla/Install/DB.pm index 248e72852..ff04fe794 100644 --- a/Bugzilla/Install/DB.pm +++ b/Bugzilla/Install/DB.pm @@ -1843,8 +1843,7 @@ sub _convert_groups_system_from_groupset { my ($admin_gid) = $dbh->selectrow_array("SELECT id FROM groups WHERE name = 'admin'"); if (!$admin_gid) { - $dbh->do( - q{INSERT INTO groups (name, description) + $dbh->do(q{INSERT INTO groups (name, description) VALUES ('admin', 'Administrators')} ); $admin_gid = $dbh->bz_last_key('groups', 'id'); @@ -2255,7 +2254,7 @@ sub _copy_old_charts_into_database { # We also add a new query for "Open", so that migrated products get # the same set as new products (see editproducts.cgi.) my @openedstatuses = ("UNCONFIRMED", "NEW", "ASSIGNED", "REOPENED"); - my $query = join("&", map {"bug_status=$_"} @openedstatuses); + my $query = join("&", map {"bug_status=$_"} @openedstatuses); my $series = new Bugzilla::Series(undef, $product, $all_name, $open_name, undef, 1, $query_prod . $query, 1); @@ -3362,8 +3361,7 @@ sub _initialize_workflow_for_upgrade { sub _make_lang_setting_dynamic { my $dbh = Bugzilla->dbh; - my $count = $dbh->selectrow_array( - q{SELECT 1 FROM setting + my $count = $dbh->selectrow_array(q{SELECT 1 FROM setting WHERE name = 'lang' AND subclass IS NULL} ); @@ -3654,7 +3652,7 @@ sub _set_attachment_comment_type { my $text = $comments{$id}; next if $text !~ /^\Q$string\E(\d+)/; my $attachment_id = $1; - my @lines = split("\n", $text); + my @lines = split("\n", $text); if ($type == CMT_ATTACHMENT_CREATED) { # Now we have to remove the text up until we find a line that's @@ -3723,7 +3721,7 @@ sub _convert_flagtypes_fks_to_set_null { } sub _fix_decimal_types { - my $dbh = Bugzilla->dbh; + my $dbh = Bugzilla->dbh; my $type = {TYPE => 'decimal(7,2)', NOTNULL => 1, DEFAULT => '0'}; $dbh->bz_alter_column('bugs', 'estimated_time', $type); $dbh->bz_alter_column('bugs', 'remaining_time', $type); @@ -3732,7 +3730,7 @@ sub _fix_decimal_types { sub _fix_series_creator_fk { my $dbh = Bugzilla->dbh; - my $fk = $dbh->bz_fk_info('series', 'creator'); + my $fk = $dbh->bz_fk_info('series', 'creator'); if ($fk and $fk->{DELETE} eq 'SET NULL') { $fk->{DELETE} = 'CASCADE'; $dbh->bz_alter_fk('series', 'creator', $fk); @@ -3889,7 +3887,7 @@ sub _migrate_user_tags { indicate_progress({current => ++$current, total => $total, every => 25}); - my $uri = URI->new("buglist.cgi?$query", 'http'); + my $uri = URI->new("buglist.cgi?$query", 'http'); my $bug_id_list = $uri->query_param_delete('bug_id'); if (!$bug_id_list) { warn "No bug_id param for tag $name from user $user_id: $query"; @@ -3986,7 +3984,7 @@ sub _rename_tags_to_tag { sub _on_delete_set_null_for_audit_log_userid { my $dbh = Bugzilla->dbh; - my $fk = $dbh->bz_fk_info('audit_log', 'user_id'); + my $fk = $dbh->bz_fk_info('audit_log', 'user_id'); if ($fk and !defined $fk->{DELETE}) { $fk->{DELETE} = 'SET NULL'; $dbh->bz_alter_fk('audit_log', 'user_id', $fk); @@ -4027,7 +4025,7 @@ sub _fix_longdescs_primary_key { } sub _fix_longdescs_indexes { - my $dbh = Bugzilla->dbh; + my $dbh = Bugzilla->dbh; my $bug_id_idx = $dbh->bz_index_info('longdescs', 'longdescs_bug_id_idx'); if ($bug_id_idx && scalar @{$bug_id_idx->{'FIELDS'}} < 2) { $dbh->bz_drop_index('longdescs', 'longdescs_bug_id_idx'); @@ -4126,7 +4124,7 @@ sub _add_password_salt_separator { sub _fix_flagclusions_indexes { my $dbh = Bugzilla->dbh; foreach my $table ('flaginclusions', 'flagexclusions') { - my $index = $table . '_type_id_idx'; + my $index = $table . '_type_id_idx'; my $idx_info = $dbh->bz_index_info($table, $index); if ($idx_info && $idx_info->{'TYPE'} ne 'UNIQUE') { @@ -4187,8 +4185,7 @@ sub _update_alias { return unless $dbh->bz_column_info('bugs', 'alias'); # We need to move the aliases from the bugs table to the bugs_aliases table - $dbh->do( - q{ + $dbh->do(q{ INSERT INTO bugs_aliases (bug_id, alias) SELECT bug_id, alias FROM bugs WHERE alias IS NOT NULL } diff --git a/Bugzilla/Install/Filesystem.pm b/Bugzilla/Install/Filesystem.pm index e309dc942..8d6163223 100644 --- a/Bugzilla/Install/Filesystem.pm +++ b/Bugzilla/Install/Filesystem.pm @@ -459,7 +459,7 @@ EOT ); my %all_files = (%create_files, %htaccess, %index_html, %files); - my %all_dirs = (%create_dirs, %non_recurse_dirs); + my %all_dirs = (%create_dirs, %non_recurse_dirs); return { create_dirs => \%create_dirs, @@ -683,7 +683,7 @@ sub _create_files { unless (-e $file) { print "Creating $file...\n"; my $info = $files{$file}; - my $fh = new IO::File($file, O_WRONLY | O_CREAT, $info->{perms}) || die $!; + my $fh = new IO::File($file, O_WRONLY | O_CREAT, $info->{perms}) || die $!; print $fh $info->{contents} if $info->{contents}; $fh->close; } diff --git a/Bugzilla/Install/Requirements.pm b/Bugzilla/Install/Requirements.pm index 4c10263ee..852f7f78e 100644 --- a/Bugzilla/Install/Requirements.pm +++ b/Bugzilla/Install/Requirements.pm @@ -63,14 +63,12 @@ use constant APACHE => qw(apachectl httpd apache2 apache); # If we don't find any of the above binaries in the normal PATH, # these are extra places we look. -use constant APACHE_PATH => [ - qw( +use constant APACHE_PATH => [qw( /usr/sbin /usr/local/sbin /usr/libexec /usr/local/libexec - ) -]; + )]; # The below two constants are subroutines so that they can implement # a hook. Other than that they are actually constants. @@ -475,7 +473,7 @@ sub check_requirements { my ($output) = @_; print "\n", install_string('checking_modules'), "\n" if $output; - my $root = ROOT_USER; + my $root = ROOT_USER; my $missing = _check_missing(REQUIRED_MODULES, $output); print "\n", install_string('checking_dbd'), "\n" if $output; @@ -608,7 +606,7 @@ sub print_module_instructions { if (my @missing = @{$check_results->{apache}}) { print install_string('modules_message_apache'); my $missing_string = join(', ', @missing); - my $size = TABLE_WIDTH - 7; + my $size = TABLE_WIDTH - 7; printf "* \%-${size}s *\n", $missing_string; my $spaces = TABLE_WIDTH - 2; print "*", (' ' x $spaces), "*\n"; diff --git a/Bugzilla/Install/Util.pm b/Bugzilla/Install/Util.pm index 26e58c772..617977241 100644 --- a/Bugzilla/Install/Util.pm +++ b/Bugzilla/Install/Util.pm @@ -620,7 +620,7 @@ sub set_output_encoding { sub init_console { eval { ON_WINDOWS && require Win32::Console::ANSI; }; $ENV{'ANSI_COLORS_DISABLED'} = 1 if ($@ || !-t *STDOUT); - $SIG{__DIE__} = \&_console_die; + $SIG{__DIE__} = \&_console_die; prevent_windows_dialog_boxes(); set_output_encoding(); } diff --git a/Bugzilla/Job/Mailer.pm b/Bugzilla/Job/Mailer.pm index 4a32f0d05..544d86107 100644 --- a/Bugzilla/Job/Mailer.pm +++ b/Bugzilla/Job/Mailer.pm @@ -34,7 +34,7 @@ sub retry_delay { sub work { my ($class, $job) = @_; - my $msg = $job->arg->{msg}; + my $msg = $job->arg->{msg}; my $success = eval { MessageToMTA($msg, 1); 1; }; if (!$success) { $job->failed($@); diff --git a/Bugzilla/JobQueue/Runner.pm b/Bugzilla/JobQueue/Runner.pm index a1803be6e..a9eb0bca4 100644 --- a/Bugzilla/JobQueue/Runner.pm +++ b/Bugzilla/JobQueue/Runner.pm @@ -146,7 +146,7 @@ END else { print "Please edit $dest_file to configure the daemon.\n"; } - } + } } sub gd_can_uninstall { @@ -160,7 +160,7 @@ sub gd_can_uninstall { } system($chkconfig, '--del', $initscript); print "$initscript disabled.", " To stop it, run: $initd/$initscript stop\n"; - } + } } return $self->SUPER::gd_can_install(@_); diff --git a/Bugzilla/Migrate.pm b/Bugzilla/Migrate.pm index 75b5eda59..d8189f5f3 100644 --- a/Bugzilla/Migrate.pm +++ b/Bugzilla/Migrate.pm @@ -690,7 +690,7 @@ sub insert_bugs { my $dbh = Bugzilla->dbh; say get_text('migrate_creating_bugs'); - my $init_statuses = Bugzilla::Status->can_change_to(); + my $init_statuses = Bugzilla::Status->can_change_to(); my %allowed_statuses = map { lc($_->name) => 1 } @$init_statuses; # Bypass the question of whether or not we can file UNCONFIRMED diff --git a/Bugzilla/Migrate/Gnats.pm b/Bugzilla/Migrate/Gnats.pm index 3d51aa60d..a5aa642e1 100644 --- a/Bugzilla/Migrate/Gnats.pm +++ b/Bugzilla/Migrate/Gnats.pm @@ -280,7 +280,7 @@ sub _read_products { my %product = (name => $name, description => $description); my @initial_cc = split(',', $cc); - @initial_cc = @{$self->translate_value('user', \@initial_cc)}; + @initial_cc = @{$self->translate_value('user', \@initial_cc)}; $assigned_to = $self->translate_value('user', $assigned_to); my %component = ( name => $self->config('component_name'), diff --git a/Bugzilla/Milestone.pm b/Bugzilla/Milestone.pm index be49df536..815a111f8 100644 --- a/Bugzilla/Milestone.pm +++ b/Bugzilla/Milestone.pm @@ -73,7 +73,7 @@ sub new { } my $condition = 'product_id = ? AND value = ?'; - my @values = ($product->id, $name); + my @values = ($product->id, $name); $param = {condition => $condition, values => \@values}; } diff --git a/Bugzilla/Object.pm b/Bugzilla/Object.pm index 863eabc00..753ad9047 100644 --- a/Bugzilla/Object.pm +++ b/Bugzilla/Object.pm @@ -301,7 +301,7 @@ sub check { sub match { my ($invocant, $criteria) = @_; my $class = ref($invocant) || $invocant; - my $dbh = Bugzilla->dbh; + my $dbh = Bugzilla->dbh; return [$class->get_all] if !$criteria; @@ -547,7 +547,7 @@ sub update { Bugzilla->memcached->clear({table => $table, id => $self->id}); Bugzilla->memcached->clear_config() if $self->IS_CONFIG; } - $self->_object_cache_remove({id => $self->id}); + $self->_object_cache_remove({id => $self->id}); $self->_object_cache_remove({name => $self->name}) if $self->name; if (wantarray) { @@ -572,7 +572,7 @@ sub remove_from_db { Bugzilla->memcached->clear({table => $table, id => $self->id}); Bugzilla->memcached->clear_config() if $self->IS_CONFIG; } - $self->_object_cache_remove({id => $self->id}); + $self->_object_cache_remove({id => $self->id}); $self->_object_cache_remove({name => $self->name}) if $self->name; undef $self; } @@ -595,7 +595,7 @@ sub audit_log { # We put the object's name in the "added" or "removed" field. # We do this thing with NAME_FIELD because $self->name returns # the wrong thing for Bugzilla::User. - my $name = $self->{$self->NAME_FIELD}; + my $name = $self->{$self->NAME_FIELD}; my @added_removed = $changes eq AUDIT_CREATE ? (undef, $name) : ($name, undef); $sth->execute($user_id, $class, $self->id, $changes, @added_removed); return; diff --git a/Bugzilla/Product.pm b/Bugzilla/Product.pm index 1f80db451..2b39c2819 100644 --- a/Bugzilla/Product.pm +++ b/Bugzilla/Product.pm @@ -112,7 +112,7 @@ sub create { # of products. sub preload { my ($products, $preload_flagtypes) = @_; - my %prods = map { $_->id => $_ } @$products; + my %prods = map { $_->id => $_ } @$products; my @prod_ids = keys %prods; return unless @prod_ids; @@ -120,7 +120,7 @@ sub preload { require Bugzilla::Component; foreach my $field (qw(component version milestone)) { my $classname = "Bugzilla::" . ucfirst($field); - my $objects = $classname->match({product_id => \@prod_ids}); + my $objects = $classname->match({product_id => \@prod_ids}); # Now populate the products with this set of objects. foreach my $obj (@$objects) { @@ -843,7 +843,7 @@ sub flag_types { # We cache flag types to avoid useless calls to get_clusions(). my $cache = Bugzilla->request_cache->{flag_types_per_product} ||= {}; $self->{flag_types} = {}; - my $prod_id = $self->id; + my $prod_id = $self->id; my $flagtypes = Bugzilla::FlagType::match({product_id => $prod_id}); foreach my $type ('bug', 'attachment') { diff --git a/Bugzilla/Search.pm b/Bugzilla/Search.pm index 17f932869..2005fe4db 100644 --- a/Bugzilla/Search.pm +++ b/Bugzilla/Search.pm @@ -412,7 +412,7 @@ use constant COLUMN_DEPENDS => { # fields it needs a little help. sub COLUMN_JOINS { my $invocant = shift; - my $user = blessed($invocant) ? $invocant->_user : Bugzilla->user; + my $user = blessed($invocant) ? $invocant->_user : Bugzilla->user; my $joins = { actual_time => { @@ -614,7 +614,7 @@ sub COLUMNS { sub REPORT_COLUMNS { my $invocant = shift; - my $user = blessed($invocant) ? $invocant->_user : Bugzilla->user; + my $user = blessed($invocant) ? $invocant->_user : Bugzilla->user; my $columns = dclone(blessed($invocant) ? $invocant->COLUMNS : COLUMNS); @@ -658,7 +658,7 @@ use constant GROUP_BY_SKIP => qw( # Note that the params argument may be modified by Bugzilla::Search sub new { my $invocant = shift; - my $class = ref($invocant) || $invocant; + my $class = ref($invocant) || $invocant; my $self = {@_}; bless($self, $class); @@ -674,7 +674,7 @@ sub new { # do it, because there's no way to know if we were passed a tied hash # or not. my $params_in = $self->_params; - my %params = map { $_ => $params_in->{$_} } keys %$params_in; + my %params = map { $_ => $params_in->{$_} } keys %$params_in; $self->{params} = \%params; return $self; @@ -707,7 +707,7 @@ sub data { my $sql = $self->_sql; # Do we just want bug IDs to pass to the 2nd query or all the data immediately? - my $func = $all_in_bugs_table ? 'selectall_arrayref' : 'selectcol_arrayref'; + my $func = $all_in_bugs_table ? 'selectall_arrayref' : 'selectcol_arrayref'; my $bug_ids = $dbh->$func($sql); my @extra_data = ({sql => $sql, time => tv_interval($start_time)}); @@ -806,13 +806,13 @@ sub search_description { sub boolean_charts_to_custom_search { my ($self, $cgi_buffer) = @_; my $boolean_charts = $self->_boolean_charts; - my @as_params = $boolean_charts ? $boolean_charts->as_params : (); + my @as_params = $boolean_charts ? $boolean_charts->as_params : (); # We need to start our new ids after the last custom search "f" id. # We can just pick the last id in the array because they are sorted # numerically. my $last_id = ($self->_field_ids)[-1]; - my $count = defined($last_id) ? $last_id + 1 : 0; + my $count = defined($last_id) ? $last_id + 1 : 0; foreach my $param_set (@as_params) { foreach my $name (keys %$param_set) { my $value = $param_set->{$name}; @@ -1329,7 +1329,7 @@ sub _sql_where { # The newline and this particular spacing makes the resulting # SQL a bit more readable for debugging. - my $where = join("\n AND ", $self->_standard_where); + my $where = join("\n AND ", $self->_standard_where); my $clause_sql = $main_clause->as_string; $where .= "\n AND " . $clause_sql if $clause_sql; return $where; @@ -1685,7 +1685,7 @@ sub _boolean_charts { my @param_list = keys %$params; my @all_field_params = grep {/^field-?\d+/} @param_list; - my @chart_ids = map { /^field(-?\d+)/; $1 } @all_field_params; + my @chart_ids = map { /^field(-?\d+)/; $1 } @all_field_params; @chart_ids = sort { $a <=> $b } uniq @chart_ids; my $clause = new Bugzilla::Search::Clause(); @@ -1776,7 +1776,7 @@ sub _field_ids { my @param_list = keys %$params; my @field_params = grep {/^f\d+$/} @param_list; - my @field_ids = map { /(\d+)/; $1 } @field_params; + my @field_ids = map { /(\d+)/; $1 } @field_params; @field_ids = sort { $a <=> $b } @field_ids; return @field_ids; } @@ -2843,7 +2843,7 @@ sub _multiselect_negative { my ($field, $operator) = @$args{qw(field operator)}; $args->{operator} = $self->_reverse_operator($operator); - $args->{term} = $self->_multiselect_term($args, 1); + $args->{term} = $self->_multiselect_term($args, 1); } sub _multiselect_multiple { @@ -2968,7 +2968,7 @@ sub _multiselect_table { } elsif ($field eq 'longdesc') { $args->{_extra_where} = " AND isprivate = 0" if !$self->_user->is_insider; - $args->{full_field} = 'thetext'; + $args->{full_field} = 'thetext'; return "longdescs"; } elsif ($field eq 'longdescs.isprivate') { @@ -3284,7 +3284,7 @@ sub _changedbefore_changedafter { } my $sql_operator = ($operator =~ /before/) ? '<=' : '>='; - my $field_id = $field_object->id; + my $field_id = $field_object->id; # Charts on changed* fields need to be field-specific. Otherwise, # OR chart rows make no sense if they contain multiple fields. @@ -3308,7 +3308,7 @@ sub _changedfrom_changedto { my ($chart_id, $joins, $field, $operator, $quoted) = @$args{qw(chart_id joins field operator quoted)}; - my $column = ($operator =~ /from/) ? 'removed' : 'added'; + my $column = ($operator =~ /from/) ? 'removed' : 'added'; my $field_object = $self->_chart_fields->{$field} || ThrowCodeError("invalid_field_name", {field => $field}); my $field_id = $field_object->id; diff --git a/Bugzilla/Search/Quicksearch.pm b/Bugzilla/Search/Quicksearch.pm index 10472b0c3..85cb2770f 100644 --- a/Bugzilla/Search/Quicksearch.pm +++ b/Bugzilla/Search/Quicksearch.pm @@ -85,12 +85,10 @@ sub FIELD_MAP { # Also, don't allow searching the _accessible stuff via quicksearch # (both because it's unnecessary and because otherwise # "reporter_accessible" and "reporter" both match "rep". - delete @full_map{ - qw(rep_platform bug_status bug_file_loc bug_group + delete @full_map{qw(rep_platform bug_status bug_file_loc bug_group bug_severity bug_status status_whiteboard - cclist_accessible reporter_accessible) - }; + cclist_accessible reporter_accessible)}; Bugzilla::Hook::process('quicksearch_map', {'map' => \%full_map}); @@ -256,7 +254,7 @@ sub quicksearch { } # List of quicksearch-specific CGI parameters to get rid of. - my @params_to_strip = ('quicksearch', 'load', 'run'); + my @params_to_strip = ('quicksearch', 'load', 'run'); my $modified_query_string = $cgi->canonicalise_query(@params_to_strip); if ($cgi->param('load')) { @@ -379,7 +377,7 @@ sub _handle_special_first_chars { return 0 if !defined $qsword || length($qsword) <= 1; my $firstChar = substr($qsword, 0, 1); - my $baseWord = substr($qsword, 1); + my $baseWord = substr($qsword, 1); my @subWords = split(/,/, $baseWord); if ($firstChar eq '#') { @@ -507,7 +505,7 @@ sub _translate_field_name { # Check if we match, as a starting substring, exactly one field. my @field_names = keys %$field_map; - my @matches = grep { $_ =~ /^\Q$field\E/ } @field_names; + my @matches = grep { $_ =~ /^\Q$field\E/ } @field_names; # Eliminate duplicates that are actually the same field # (otherwise "assi" matches both "assignee" and "assigned_to", and diff --git a/Bugzilla/Search/Saved.pm b/Bugzilla/Search/Saved.pm index 1611cea56..c988e8997 100644 --- a/Bugzilla/Search/Saved.pm +++ b/Bugzilla/Search/Saved.pm @@ -66,7 +66,7 @@ sub new { ThrowCodeError('bad_arg', {argument => 'name', function => "${class}::new"}); } my $condition = 'userid = ? AND name = ?'; - my $user_id = blessed $user ? $user->id : $user; + my $user_id = blessed $user ? $user->id : $user; detaint_natural($user_id) || ThrowCodeError('param_must_be_numeric', {function => $class . '::_init', param => 'user'}); @@ -206,7 +206,7 @@ sub preload { return unless scalar @$searches; - my @query_ids = map { $_->id } @$searches; + my @query_ids = map { $_->id } @$searches; my $queries_in_footer = $dbh->selectcol_arrayref( 'SELECT namedquery_id FROM namedqueries_link_in_footer @@ -252,7 +252,7 @@ sub link_in_footer { # We only cache link_in_footer for the current Bugzilla->user. return $self->{link_in_footer} if exists $self->{link_in_footer} && !$user; - my $user_id = $user ? $user->id : Bugzilla->user->id; + my $user_id = $user ? $user->id : Bugzilla->user->id; my $link_in_footer = Bugzilla->dbh->selectrow_array( 'SELECT 1 FROM namedqueries_link_in_footer WHERE namedquery_id = ? AND user_id = ?', undef, $self->id, $user_id diff --git a/Bugzilla/Series.pm b/Bugzilla/Series.pm index 36b6d13ad..ec0a16e34 100644 --- a/Bugzilla/Series.pm +++ b/Bugzilla/Series.pm @@ -28,7 +28,7 @@ use constant ID_FIELD => 'series_id'; sub new { my $invocant = shift; - my $class = ref($invocant) || $invocant; + my $class = ref($invocant) || $invocant; # Create a ref to an empty hash and bless it my $self = {}; diff --git a/Bugzilla/Template.pm b/Bugzilla/Template.pm index de421a290..ea319b4f0 100644 --- a/Bugzilla/Template.pm +++ b/Bugzilla/Template.pm @@ -90,7 +90,7 @@ sub _load_constants { # If no Accept-Language is present it uses the defined default # Templates may also be found in the extensions/ tree sub _include_path { - my $lang = shift || ''; + my $lang = shift || ''; my $cache = Bugzilla->request_cache; $cache->{"template_include_path_$lang"} ||= template_include_path({language => $lang}); @@ -381,7 +381,7 @@ sub multiline_sprintf { my @parts; my @my_sizes = @$sizes; # Copy this so we don't modify the input array. foreach my $string (@$args) { - my $size = shift @my_sizes; + my $size = shift @my_sizes; my @pieces = split("\n", wrap_hard($string, $size)); push(@parts, \@pieces); } @@ -782,7 +782,7 @@ sub create { my ($context, $isinactive) = @_; return sub { return $isinactive ? '' . $_[0] . '' : $_[0]; - } + } }, 1 ], @@ -792,7 +792,7 @@ sub create { my ($context, $isclosed) = @_; return sub { return $isclosed ? '' . $_[0] . '' : $_[0]; - } + } }, 1 ], @@ -802,7 +802,7 @@ sub create { my ($context, $isobsolete) = @_; return sub { return $isobsolete ? '' . $_[0] . '' : $_[0]; - } + } }, 1 ], diff --git a/Bugzilla/User.pm b/Bugzilla/User.pm index b797f364e..5426cc8fa 100644 --- a/Bugzilla/User.pm +++ b/Bugzilla/User.pm @@ -153,16 +153,14 @@ sub _update_groups { my $dbh = Bugzilla->dbh; # Update group settings. - my $sth_add_mapping = $dbh->prepare( - qq{INSERT INTO user_group_map ( + my $sth_add_mapping = $dbh->prepare(qq{INSERT INTO user_group_map ( user_id, group_id, isbless, grant_type ) VALUES ( ?, ?, ?, ? ) } ); - my $sth_remove_mapping = $dbh->prepare( - qq{DELETE FROM user_group_map + my $sth_remove_mapping = $dbh->prepare(qq{DELETE FROM user_group_map WHERE user_id = ? AND group_id = ? AND isbless = ? @@ -753,7 +751,7 @@ sub save_last_search { # prevents people from writing over their whole # recent-search list by just refreshing a saved search # (which doesn't have list_id in the header) over and over. - my $list_string = join(',', @$bug_ids); + my $list_string = join(',', @$bug_ids); my $existing_search = Bugzilla::Search::Recent->match( {user_id => $self->id, bug_list => $list_string}); @@ -920,7 +918,7 @@ sub groups { # Add all its members to the FIFO check list # %group_membership contains arrays of group members # for all groups. Accessible by group number. - my $members = $group_membership{$member_id}; + my $members = $group_membership{$member_id}; my @new_to_check = grep(!$checked_groups{$_}, @$members); push(@$groups_to_check, @new_to_check); @@ -1099,7 +1097,7 @@ sub get_products_by_permission { # We will restrict the list to products the user can see. my $selectable_products = $self->get_selectable_products; - my @products = grep { $product_map{$_->id} } @$selectable_products; + my @products = grep { $product_map{$_->id} } @$selectable_products; return \@products; } @@ -1181,7 +1179,7 @@ sub visible_bugs { # Bugzilla::Bug->update automatically removes updated bugs # from the cache to force them to be checked again. my $visible_cache = $self->{_visible_bugs_cache} ||= {}; - my @check_ids = grep(!exists $visible_cache->{$_}, @bug_ids); + my @check_ids = grep(!exists $visible_cache->{$_}, @bug_ids); if (@check_ids) { foreach my $id (@check_ids) { @@ -1361,7 +1359,7 @@ sub get_selectable_classifications { my ($self) = @_; if (!defined $self->{selectable_classifications}) { - my $products = $self->get_selectable_products; + my $products = $self->get_selectable_products; my %class_ids = map { $_->classification_id => 1 } @$products; $self->{selectable_classifications} @@ -1540,7 +1538,7 @@ sub check_can_admin_product { sub check_can_admin_flagtype { my ($self, $flagtype_id) = @_; - my $flagtype = Bugzilla::FlagType->check({id => $flagtype_id}); + my $flagtype = Bugzilla::FlagType->check({id => $flagtype_id}); my $can_fully_edit = 1; if (!$self->in_group('editcomponents')) { @@ -1704,13 +1702,11 @@ sub derive_regexp_groups { ); $sth->execute($id, GRANT_REGEXP); - my $group_insert = $dbh->prepare( - q{INSERT INTO user_group_map + my $group_insert = $dbh->prepare(q{INSERT INTO user_group_map (user_id, group_id, isbless, grant_type) VALUES (?, ?, 0, ?)} ); - my $group_delete = $dbh->prepare( - q{DELETE FROM user_group_map + my $group_delete = $dbh->prepare(q{DELETE FROM user_group_map WHERE user_id = ? AND group_id = ? AND isbless = 0 @@ -1756,7 +1752,7 @@ sub product_responsibilities { # We cannot |use| it, because Component.pm already |use|s User.pm. require Bugzilla::Component; - my @comp_ids = map { $_->{'id'} } @$list; + my @comp_ids = map { $_->{'id'} } @$list; my $components = Bugzilla::Component->new_from_list(\@comp_ids); my @prod_list; @@ -1888,8 +1884,8 @@ sub match { } sub match_field { - my $fields = shift; # arguments as a hash - my $data = shift || Bugzilla->input_params; # hash to look up fields in + my $fields = shift; # arguments as a hash + my $data = shift || Bugzilla->input_params; # hash to look up fields in my $behavior = shift || 0; # A constant that tells us how to act my $matches = {}; # the values sent to the template my $matchsuccess = 1; # did the match fail? @@ -2383,7 +2379,7 @@ sub create { # Add the creation date to the profiles_activity table. # $who is the user who created the new user account, i.e. either an # admin or the new user himself. - my $who = Bugzilla->user->id || $user->id; + my $who = Bugzilla->user->id || $user->id; my $creation_date_fieldid = get_field_id('creation_ts'); $dbh->do( @@ -2536,7 +2532,7 @@ sub check_and_send_account_creation_confirmation { # do check() and pull all the user data from the database. sub login_to_id { my ($login, $throw_error) = @_; - my $dbh = Bugzilla->dbh; + my $dbh = Bugzilla->dbh; my $cache = Bugzilla->request_cache->{user_login_to_id} ||= {}; # We cache lookups because this function showed up as taking up a diff --git a/Bugzilla/User/Setting.pm b/Bugzilla/User/Setting.pm index 94171a5d9..67f5c5684 100644 --- a/Bugzilla/User/Setting.pm +++ b/Bugzilla/User/Setting.pm @@ -35,7 +35,7 @@ sub new { my $setting_name = shift; my $user_id = shift; - my $class = ref($invocant) || $invocant; + my $class = ref($invocant) || $invocant; my $subclass = ''; # Create a ref to an empty hash and bless it @@ -149,8 +149,7 @@ sub add_setting { VALUES (?, ?, 1, ?)}, undef, ($name, $default_value, $subclass) ); - my $sth = $dbh->prepare( - q{INSERT INTO setting_value (name, value, sortindex) + my $sth = $dbh->prepare(q{INSERT INTO setting_value (name, value, sortindex) VALUES (?, ?, ?)} ); @@ -167,7 +166,7 @@ sub get_all_settings { my $dbh = Bugzilla->dbh; my $cache_key = "user_settings.$user_id"; - my $rows = Bugzilla->memcached->get_config({key => $cache_key}); + my $rows = Bugzilla->memcached->get_config({key => $cache_key}); if (!$rows) { $rows = $dbh->selectall_arrayref( q{SELECT name, default_value, is_enabled, setting_value, subclass @@ -232,8 +231,7 @@ sub set_default { my ($setting_name, $default_value, $is_enabled) = @_; my $dbh = Bugzilla->dbh; - my $sth = $dbh->prepare( - q{UPDATE setting + my $sth = $dbh->prepare(q{UPDATE setting SET default_value = ?, is_enabled = ? WHERE name = ?} ); diff --git a/Bugzilla/Util.pm b/Bugzilla/Util.pm index 0edd361ce..572479777 100644 --- a/Bugzilla/Util.pm +++ b/Bugzilla/Util.pm @@ -147,7 +147,7 @@ sub html_light_quote { if (!Bugzilla->feature('html_desc')) { my $safe = join('|', @allow); - my $chr = chr(1); + my $chr = chr(1); # First, escape safe elements. $text =~ s#<($safe)>#$chr$1$chr#go; @@ -168,7 +168,7 @@ sub html_light_quote { push(@allow, qw(a blockquote q span)); # Allowed protocols. - my $safe_protocols = join('|', SAFE_PROTOCOLS); + my $safe_protocols = join('|', SAFE_PROTOCOLS); my $protocol_regexp = qr{(^(?:$safe_protocols):|^[^:]+$)}i; # Deny all elements and attributes unless explicitly authorized. @@ -225,7 +225,7 @@ sub email_filter { if (!Bugzilla->user->id) { my @emails = Email::Address->parse($toencode); if (scalar @emails) { - my @hosts = map { quotemeta($_->host) } @emails; + my @hosts = map { quotemeta($_->host) } @emails; my $hosts_re = join('|', @hosts); $toencode =~ s/\@(?:$hosts_re)//g; return $toencode; @@ -320,7 +320,7 @@ sub correct_urlbase { } sub remote_ip { - my $ip = $ENV{'REMOTE_ADDR'} || '127.0.0.1'; + my $ip = $ENV{'REMOTE_ADDR'} || '127.0.0.1'; my @proxies = split(/[\s,]+/, Bugzilla->params->{'inbound_proxies'}); # If the IP address is one of our trusted proxies, then we look at @@ -778,7 +778,7 @@ sub validate_date { if ($ts) { $date2 = time2str("%Y-%m-%d", $ts); - $date =~ s/(\d+)-0*(\d+?)-0*(\d+?)/$1-$2-$3/; + $date =~ s/(\d+)-0*(\d+?)-0*(\d+?)/$1-$2-$3/; $date2 =~ s/(\d+)-0*(\d+?)-0*(\d+?)/$1-$2-$3/; } my $ret = ($ts && $date eq $date2); diff --git a/Bugzilla/Version.pm b/Bugzilla/Version.pm index 6a5930574..dfc5a8e0f 100644 --- a/Bugzilla/Version.pm +++ b/Bugzilla/Version.pm @@ -76,7 +76,7 @@ sub new { } my $condition = 'product_id = ? AND value = ?'; - my @values = ($product->id, $name); + my @values = ($product->id, $name); $param = {condition => $condition, values => \@values}; } diff --git a/Bugzilla/WebService/Bug.pm b/Bugzilla/WebService/Bug.pm index a5de3b68e..5852928c1 100644 --- a/Bugzilla/WebService/Bug.pm +++ b/Bugzilla/WebService/Bug.pm @@ -133,7 +133,7 @@ sub fields { foreach my $field (@fields) { my $visibility_field = $field->visibility_field ? $field->visibility_field->name : undef; - my $vis_values = $field->visibility_values; + my $vis_values = $field->visibility_values; my $value_field = $field->value_field ? $field->value_field->name : undef; my (@values, $has_values); @@ -142,7 +142,7 @@ sub fields { or $field->name eq 'keywords') { $has_values = 1; - @values = @{$self->_legal_field_values({field => $field})}; + @values = @{$self->_legal_field_values({field => $field})}; } if (grep($_ eq $field->name, PRODUCT_SPECIFIC_FIELDS)) { @@ -162,7 +162,7 @@ sub fields { ); if ($has_values) { $field_data{value_field} = $self->type('string', $value_field); - $field_data{values} = \@values; + $field_data{values} = \@values; } push(@fields_out, filter $params, \%field_data); } @@ -317,7 +317,7 @@ sub comments { my %comments; if (scalar @$comment_ids) { - my @ids = map { trim($_) } @$comment_ids; + my @ids = map { trim($_) } @$comment_ids; my $comment_data = Bugzilla::Comment->new_from_list(\@ids); # See if we were passed any invalid comment ids. @@ -707,7 +707,7 @@ sub update { my %changes = %{$all_changes{$bug->id}}; foreach my $field (keys %changes) { - my $change = $changes{$field}; + my $change = $changes{$field}; my $api_field = $api_name{$field} || $field; # We normalize undef to an empty string, so that the API diff --git a/Bugzilla/WebService/Bugzilla.pm b/Bugzilla/WebService/Bugzilla.pm index 6d9563d61..f93892068 100644 --- a/Bugzilla/WebService/Bugzilla.pm +++ b/Bugzilla/WebService/Bugzilla.pm @@ -92,7 +92,7 @@ sub extensions { my %retval; foreach my $extension (@{Bugzilla->extensions}) { my $version = $extension->VERSION || 0; - my $name = $extension->NAME; + my $name = $extension->NAME; $retval{$name}->{version} = $self->type('string', $version); } return {extensions => \%retval}; diff --git a/Bugzilla/WebService/Server/JSONRPC.pm b/Bugzilla/WebService/Server/JSONRPC.pm index 66640beb7..7847029ba 100644 --- a/Bugzilla/WebService/Server/JSONRPC.pm +++ b/Bugzilla/WebService/Server/JSONRPC.pm @@ -364,7 +364,7 @@ sub _argument_type_check { # Now, convert dateTime fields on input. $self->_bz_method_name =~ /^(\S+)\.(\S+)$/; my ($class, $method) = ($1, $2); - my $pkg = $self->{dispatch_path}->{$class}; + my $pkg = $self->{dispatch_path}->{$class}; my @date_fields = @{$pkg->DATE_FIELDS->{$method} || []}; foreach my $field (@date_fields) { if (defined $params->{$field}) { diff --git a/Bugzilla/WebService/Server/REST.pm b/Bugzilla/WebService/Server/REST.pm index 8108e1d4f..143b938b6 100644 --- a/Bugzilla/WebService/Server/REST.pm +++ b/Bugzilla/WebService/Server/REST.pm @@ -53,7 +53,7 @@ sub handle { # unless we were looking for OPTIONS if (!$self->_find_resource($self->cgi->path_info)) { if ($self->request->method eq 'OPTIONS' && $self->bz_rest_options) { - my $response = $self->response_header(STATUS_OK, ""); + my $response = $self->response_header(STATUS_OK, ""); my $options_string = join(', ', @{$self->bz_rest_options}); $response->header( 'Allow' => $options_string, @@ -121,7 +121,7 @@ sub response { my $result = {}; if (exists $json_data->{error}) { $result = $json_data->{error}; - $result->{error} = $self->type('boolean', 1); + $result->{error} = $self->type('boolean', 1); $result->{documentation} = REST_DOC; delete $result->{'name'}; # Remove JSONRPCError } @@ -510,7 +510,7 @@ sub _get_content_prefs { # Parse the Accept header, and save type name, score, and position. my @accept_types = split /,/, $self->cgi->http('accept') || ''; - my $order = 0; + my $order = 0; for my $accept_type (@accept_types) { my ($weight) = ($accept_type =~ /q=(\d\.\d+|\d+)/); my ($name) = ($accept_type =~ m#(\S+/[^;]+)#); diff --git a/Bugzilla/WebService/Server/XMLRPC.pm b/Bugzilla/WebService/Server/XMLRPC.pm index b0eae8e19..f96f960da 100644 --- a/Bugzilla/WebService/Server/XMLRPC.pm +++ b/Bugzilla/WebService/Server/XMLRPC.pm @@ -379,7 +379,7 @@ sub BEGIN { my $super_method = "SUPER::$method"; return $self->$super_method($value); } - } + } } } diff --git a/attachment.cgi b/attachment.cgi index d8244b080..d404c85df 100755 --- a/attachment.cgi +++ b/attachment.cgi @@ -205,7 +205,7 @@ sub get_attachment { } $attachments{$field_name} = $attachment; } - my @args = map { $_ . '=' . $attachments{$_}->id } @field_names; + my @args = map { $_ . '=' . $attachments{$_}->id } @field_names; my $cgi_params = $cgi->canonicalise_query(@field_names, 't', 'Bugzilla_login', 'Bugzilla_password'); push(@args, $cgi_params) if $cgi_params; @@ -810,7 +810,7 @@ sub delete_attachment { # The token is valid. Delete the content of the attachment. my $msg; $vars->{'attachment'} = $attachment; - $vars->{'reason'} = clean_text($cgi->param('reason') || ''); + $vars->{'reason'} = clean_text($cgi->param('reason') || ''); $template->process("attachment/delete_reason.txt.tmpl", $vars, \$msg) || ThrowTemplateError($template->error()); diff --git a/buglist.cgi b/buglist.cgi index aa0faa426..57b593930 100755 --- a/buglist.cgi +++ b/buglist.cgi @@ -370,7 +370,7 @@ if ($cmdtype eq "dorem") { $vars->{'search_id'} = $query_id; } $params = new Bugzilla::CGI($buffer); - $order = $params->param('order') || $order; + $order = $params->param('order') || $order; } elsif ($remaction eq "runseries") { @@ -912,7 +912,7 @@ $vars->{'buglist'} = \@bugidlist; $vars->{'columns'} = $columns; $vars->{'displaycolumns'} = \@displaycolumns; -$vars->{'openstates'} = [BUG_STATE_OPEN]; +$vars->{'openstates'} = [BUG_STATE_OPEN]; $vars->{'closedstates'} = [map { $_->name } closed_bug_statuses()]; # The iCal file needs priorities ordered from 1 to 9 (highest to lowest) @@ -1018,7 +1018,7 @@ if ($dotweak && scalar @bugs) { = _get_common_flag_types([keys %$bugcomponentids]); # Convert bug statuses to their ID. - my @bug_statuses = map { $dbh->quote($_) } keys %$bugstatuses; + my @bug_statuses = map { $dbh->quote($_) } keys %$bugstatuses; my $bug_status_ids = $dbh->selectcol_arrayref( 'SELECT id FROM bug_status WHERE ' . $dbh->sql_in('value', \@bug_statuses) @@ -1122,7 +1122,7 @@ my $disposition = "inline"; if ($format->{'extension'} eq "html") { my $list_id = $cgi->param('list_id') || $cgi->param('regetlastlist'); - my $search = $user->save_last_search( + my $search = $user->save_last_search( {bugs => \@bugidlist, order => $order, vars => $vars, list_id => $list_id}); $cgi->param('list_id', $search->id) if $search; $contenttype = "text/html"; diff --git a/chart.cgi b/chart.cgi index a8c609fce..bfbbf300e 100755 --- a/chart.cgi +++ b/chart.cgi @@ -76,7 +76,7 @@ $vars->{'doc_section'} = 'using/reports-and-charts.html#charts'; # series_id they apply to (e.g. subscribe, unsubscribe). my @actions = grep(/^action-/, $cgi->param()); if ($actions[0] && $actions[0] =~ /^action-([^\d]+)(\d*)$/) { - $action = $1; + $action = $1; $series_id = $2 if $2; } diff --git a/checksetup.pl b/checksetup.pl index 76564e2f0..857584937 100755 --- a/checksetup.pl +++ b/checksetup.pl @@ -50,7 +50,7 @@ pod2usage({-verbose => 1, -exitval => 1}) if $switch{'help'}; # Read in the "answers" file if it exists, for running in # non-interactive mode. my $answers_file = $ARGV[0]; -my $silent = $answers_file && !$switch{'verbose'}; +my $silent = $answers_file && !$switch{'verbose'}; print(install_string('header', get_version_and_os()) . "\n") unless $silent; exit 0 if $switch{'version'}; diff --git a/colchange.cgi b/colchange.cgi index 8add4f2f7..c5f08b794 100755 --- a/colchange.cgi +++ b/colchange.cgi @@ -174,7 +174,7 @@ else { @collist = DEFAULT_COLUMN_LIST; } -$vars->{'collist'} = \@collist; +$vars->{'collist'} = \@collist; $vars->{'splitheader'} = $cgi->cookie('SPLITHEADER') ? 1 : 0; $vars->{'buffer'} = $cgi->query_string(); diff --git a/collectstats.pl b/collectstats.pl index 818f36366..f7a926499 100755 --- a/collectstats.pl +++ b/collectstats.pl @@ -165,7 +165,7 @@ sub collect_stats { my $when = localtime(time); my $dbh = Bugzilla->dbh; - my $file = join '/', $dir, $product->id; + my $file = join '/', $dir, $product->id; my $exists = -f $file; # if the file exists, get the old status and resolution list for that product. @@ -214,7 +214,7 @@ sub collect_stats { } if (!$exists || scalar(@data)) { - my $fields = join('|', ('DATE', @statuses, @resolutions)); + my $fields = join('|', ('DATE', @statuses, @resolutions)); my $product_name = $product->name; print DATA <", $file) { - my $fields = join('|', ('DATE', @statuses, @resolutions)); + my $fields = join('|', ('DATE', @statuses, @resolutions)); my $product_name = $product->name; print DATA < days, but the start date depends on the series_id. my $days_since_epoch = int(time() / (60 * 60 * 24)); - my $today = today_dash(); + my $today = today_dash(); # We save a copy of the main $dbh and then switch to the shadow and get # that one too. Remember, these may be the same. diff --git a/contrib/bzdbcopy.pl b/contrib/bzdbcopy.pl index 5556a167e..b92d9205d 100755 --- a/contrib/bzdbcopy.pl +++ b/contrib/bzdbcopy.pl @@ -101,7 +101,7 @@ foreach my $table (@table_list) { my ($total) = $source_db->selectrow_array("SELECT COUNT(*) FROM $table"); my $select_query = "SELECT " . join(',', @table_columns) . " FROM $table"; - my $select_sth = $source_db->prepare($select_query); + my $select_sth = $source_db->prepare($select_query); $select_sth->execute(); my $insert_query diff --git a/contrib/console.pl b/contrib/console.pl index a3e042236..7c1748064 100755 --- a/contrib/console.pl +++ b/contrib/console.pl @@ -27,7 +27,7 @@ $Data::Dumper::Maxdepth = 1; $Data::Dumper::Deparse = 0; my $sysname = get_text('term', {term => 'Bugzilla'}); -my $term = new Term::ReadLine "$sysname Console"; +my $term = new Term::ReadLine "$sysname Console"; read_history($term); END { write_history($term) } diff --git a/contrib/extension-convert.pl b/contrib/extension-convert.pl index d0fc791b2..a70888dc1 100755 --- a/contrib/extension-convert.pl +++ b/contrib/extension-convert.pl @@ -225,7 +225,7 @@ sub code_files_to_subroutines { next if $file =~ /install-requirements/; print "Moving $file code into Extension.pm...\n"; my ($modules, $code) = process_code_file($file); - my @code_lines = map {" $_"} @$code; + my @code_lines = map {" $_"} @$code; my $code_string = join('', @code_lines); $code_string =~ s/Bugzilla->hook_args/\$args/g; $code_string =~ s/my\s+\$args\s+=\s+\$args;//gs; @@ -244,7 +244,7 @@ END push(@subroutines, $subroutine); } - my %seen_modules = map { trim($_) => 1 } @all_modules; + my %seen_modules = map { trim($_) => 1 } @all_modules; my $module_string = join("\n", sort keys %seen_modules); my $subroutine_string = join("\n", @subroutines); return ($module_string, $subroutine_string); diff --git a/contrib/merge-users.pl b/contrib/merge-users.pl index dbc9b10fe..02129980d 100755 --- a/contrib/merge-users.pl +++ b/contrib/merge-users.pl @@ -44,7 +44,7 @@ use Pod::Usage; my $dbh = Bugzilla->dbh; # Display the help if called with --help or -?. -my $help = 0; +my $help = 0; my $result = GetOptions("help|?" => \$help); pod2usage(0) if $help; @@ -179,7 +179,7 @@ foreach my $table (keys %changes) { # Get all columns to consider. There is always at least # one column given: the one to update. - my @columns = split(/[\s]+/, $column_list); + my @columns = split(/[\s]+/, $column_list); my $cols_to_check = join(' AND ', map {"$_ = ?"} @columns); # The first column of the list is the one to update. diff --git a/contrib/recode.pl b/contrib/recode.pl index 9dc1d1bf5..fdb3ae0ac 100755 --- a/contrib/recode.pl +++ b/contrib/recode.pl @@ -186,8 +186,8 @@ foreach my $table ($dbh->bz_table_list_real) { AND $column != ''" ); - my @pk_array = map {"$_ = ?"} split(',', $pk); - my $pk_where = join(' AND ', @pk_array); + my @pk_array = map {"$_ = ?"} split(',', $pk); + my $pk_where = join(' AND ', @pk_array); my $update_sth = $dbh->prepare("UPDATE $table SET $column = ? WHERE $pk_where"); $sth->execute(); @@ -197,7 +197,7 @@ foreach my $table ($dbh->bz_table_list_real) { # Wide characters cause md5_base64() to die. my $digest_data = utf8::is_utf8($data) ? Encode::encode_utf8($data) : $data; - my $digest = md5_base64($digest_data); + my $digest = md5_base64($digest_data); my @primary_keys = reverse split(',', $pk); diff --git a/docs/lib/Pod/Simple/HTMLBatch/Bugzilla.pm b/docs/lib/Pod/Simple/HTMLBatch/Bugzilla.pm index ae05ecf87..bc96c9a0e 100644 --- a/docs/lib/Pod/Simple/HTMLBatch/Bugzilla.pm +++ b/docs/lib/Pod/Simple/HTMLBatch/Bugzilla.pm @@ -61,7 +61,7 @@ sub _write_contents_middle { foreach my $e (@downlines) { $row_count++; my $even_or_odd = $row_count % 2 ? 'even' : 'odd'; - my $name = esc($e->[0]); + my $name = esc($e->[0]); my $path = join("/", '.', esc(@{$e->[3]})) . $Pod::Simple::HTML::HTML_EXTENSION; my $description = $self->{bugzilla_desc}->{$name} || ''; $description = esc($description); diff --git a/editfields.cgi b/editfields.cgi index 0bada4598..633887db2 100755 --- a/editfields.cgi +++ b/editfields.cgi @@ -30,7 +30,7 @@ $user->in_group('admin') {group => 'admin', action => 'edit', object => 'custom_fields'}); my $action = trim($cgi->param('action') || ''); -my $token = $cgi->param('token'); +my $token = $cgi->param('token'); print $cgi->header(); diff --git a/editgroups.cgi b/editgroups.cgi index 4f759540f..b93254ebc 100755 --- a/editgroups.cgi +++ b/editgroups.cgi @@ -36,7 +36,7 @@ $user->in_group('creategroups') {group => "creategroups", action => "edit", object => "groups"}); my $action = trim($cgi->param('action') || ''); -my $token = $cgi->param('token'); +my $token = $cgi->param('token'); # CheckGroupID checks that a positive integer is given and is # actually a valid group ID. If all tests are successful, the diff --git a/editmilestones.cgi b/editmilestones.cgi index 3eef38318..c5f2e8686 100755 --- a/editmilestones.cgi +++ b/editmilestones.cgi @@ -195,7 +195,7 @@ if ($action eq 'edit') { if ($action eq 'update') { check_token_data($token, 'edit_milestone'); my $milestone_old_name = trim($cgi->param('milestoneold') || ''); - my $milestone = Bugzilla::Milestone->check( + my $milestone = Bugzilla::Milestone->check( {product => $product, name => $milestone_old_name}); $milestone->set_name($milestone_name); diff --git a/editproducts.cgi b/editproducts.cgi index 205269a61..f98225e6f 100755 --- a/editproducts.cgi +++ b/editproducts.cgi @@ -69,7 +69,7 @@ if ( Bugzilla->params->{'useclassification'} else { # Only keep classifications containing at least one product # which you can administer. - my $products = $user->get_products_by_permission('editcomponents'); + my $products = $user->get_products_by_permission('editcomponents'); my %class_ids = map { $_->classification_id => 1 } @$products; $class = Bugzilla::Classification->new_from_list([keys %class_ids]); } @@ -107,7 +107,7 @@ if (!$action && !$product_name) { @$products = grep { $_->classification_id == $classification->id } @$products; } } - $vars->{'products'} = $products; + $vars->{'products'} = $products; $vars->{'showbugcounts'} = $cgi->param('showbugcounts') ? 1 : 0; $template->process("admin/products/list.html.tmpl", $vars) @@ -298,7 +298,7 @@ if ($action eq 'edit' || (!$action && $product_name)) { if ($action eq 'update') { check_token_data($token, 'edit_product'); my $product_old_name = trim($cgi->param('product_old_name') || ''); - my $product = $user->check_can_admin_product($product_old_name); + my $product = $user->check_can_admin_product($product_old_name); $product->set_all({ name => $product_name, diff --git a/editsettings.cgi b/editsettings.cgi index 998ed0c5d..3f0ab6827 100755 --- a/editsettings.cgi +++ b/editsettings.cgi @@ -31,7 +31,7 @@ $user->in_group('tweakparams') {group => "tweakparams", action => "modify", object => "settings"}); my $action = trim($cgi->param('action') || ''); -my $token = $cgi->param('token'); +my $token = $cgi->param('token'); if ($action eq 'update') { check_token_data($token, 'edit_settings'); diff --git a/editvalues.cgi b/editvalues.cgi index 0031312c0..59e4d639f 100755 --- a/editvalues.cgi +++ b/editvalues.cgi @@ -59,7 +59,7 @@ $user->in_group('admin') # often-used variables # my $action = trim($cgi->param('action') || ''); -my $token = $cgi->param('token'); +my $token = $cgi->param('token'); # # field = '' -> Show nice list of fields diff --git a/editwhines.cgi b/editwhines.cgi index c0cfea43b..c677273bd 100755 --- a/editwhines.cgi +++ b/editwhines.cgi @@ -168,7 +168,7 @@ if ($cgi->param('update')) { # to be altered or deleted # Check schedules for changes - my $schedules = Bugzilla::Whine::Schedule->match({eventid => $eventid}); + my $schedules = Bugzilla::Whine::Schedule->match({eventid => $eventid}); my @scheduleids = (); foreach my $schedule (@$schedules) { push @scheduleids, $schedule->id; @@ -347,7 +347,7 @@ for my $event_id (keys %{$events}) { my $schedules = Bugzilla::Whine::Schedule->match({eventid => $event_id}); foreach my $schedule (@$schedules) { my $mailto_type = $schedule->mailto_is_group ? MAILTO_GROUP : MAILTO_USER; - my $mailto = ''; + my $mailto = ''; if ($mailto_type == MAILTO_USER) { $mailto = $schedule->mailto->login; } diff --git a/editworkflow.cgi b/editworkflow.cgi index 3741e825e..81b665e42 100755 --- a/editworkflow.cgi +++ b/editworkflow.cgi @@ -29,7 +29,7 @@ $user->in_group('admin') {group => 'admin', action => 'modify', object => 'workflow'}); my $action = $cgi->param('action') || 'edit'; -my $token = $cgi->param('token'); +my $token = $cgi->param('token'); sub get_workflow { my $dbh = Bugzilla->dbh; diff --git a/email_in.pl b/email_in.pl index babe868ed..a03935830 100755 --- a/email_in.pl +++ b/email_in.pl @@ -250,7 +250,7 @@ sub process_bug { # Make it possible to remove CCs. if ($fields{'removecc'}) { - $fields{'cc'} = [split(',', $fields{'removecc'})]; + $fields{'cc'} = [split(',', $fields{'removecc'})]; $fields{'removecc'} = 1; } @@ -374,7 +374,7 @@ sub get_text_alternative { my @parts = $email->parts; my $body; foreach my $part (@parts) { - my $ct = $part->content_type || 'text/plain'; + my $ct = $part->content_type || 'text/plain'; my $charset = 'iso-8859-1'; # The charset may be quoted. diff --git a/enter_bug.cgi b/enter_bug.cgi index 25b3dcf37..b4f609500 100755 --- a/enter_bug.cgi +++ b/enter_bug.cgi @@ -246,7 +246,7 @@ if ($cloned_bug_id) { # We need to ensure that we respect the 'insider' status of # the first comment, if it has one. Either way, make a note # that this bug was cloned from another bug. - my $bug_desc = $cloned_bug->comments({order => 'oldest_to_newest'})->[0]; + my $bug_desc = $cloned_bug->comments({order => 'oldest_to_newest'})->[0]; my $isprivate = $bug_desc->is_private; $vars->{'comment'} = ""; diff --git a/extensions/BmpConvert/Extension.pm b/extensions/BmpConvert/Extension.pm index d9e3d0ef4..84a2c81dc 100644 --- a/extensions/BmpConvert/Extension.pm +++ b/extensions/BmpConvert/Extension.pm @@ -22,7 +22,7 @@ sub attachment_process_data { return unless $args->{attributes}->{mimetype} eq 'image/bmp'; my $data = ${$args->{data}}; - my $img = Image::Magick->new(magick => 'bmp'); + my $img = Image::Magick->new(magick => 'bmp'); # $data is a filehandle. if (ref $data) { diff --git a/extensions/Example/Extension.pm b/extensions/Example/Extension.pm index d76c71c06..1ecb3e692 100644 --- a/extensions/Example/Extension.pm +++ b/extensions/Example/Extension.pm @@ -481,7 +481,7 @@ sub error_catch { return unless $args->{error} eq 'bad_page_cgi_id'; my $page_id = $args->{vars}->{page_id}; - my $login = Bugzilla->user->identity || "Someone"; + my $login = Bugzilla->user->identity || "Someone"; warn "$login attempted to access page.cgi with id = $page_id"; my $page = $args->{message}; diff --git a/extensions/MoreBugUrl/Extension.pm b/extensions/MoreBugUrl/Extension.pm index 55de58a5b..a6eae1be5 100644 --- a/extensions/MoreBugUrl/Extension.pm +++ b/extensions/MoreBugUrl/Extension.pm @@ -29,8 +29,7 @@ use constant MORE_SUB_CLASSES => qw( sub install_update_db { my $dbh = Bugzilla->dbh; - my $should_rename = $dbh->selectrow_array( - q{SELECT 1 FROM bug_see_also + my $should_rename = $dbh->selectrow_array(q{SELECT 1 FROM bug_see_also WHERE class IN ('Bugzilla::BugUrl::Rietveld', 'Bugzilla::BugUrl::ReviewBoard')} ); diff --git a/extensions/OldBugMove/Extension.pm b/extensions/OldBugMove/Extension.pm index 53c26fc8d..70dc5ad30 100644 --- a/extensions/OldBugMove/Extension.pm +++ b/extensions/OldBugMove/Extension.pm @@ -29,7 +29,7 @@ use constant VERSION => BUGZILLA_VERSION; use constant CMT_MOVED_TO => 4; sub install_update_db { - my $reso_type = Bugzilla::Field::Choice->type('resolution'); + my $reso_type = Bugzilla::Field::Choice->type('resolution'); my $moved_reso = $reso_type->new({name => 'MOVED'}); # We make the MOVED resolution inactive, so that it doesn't show up diff --git a/extensions/Voting/Extension.pm b/extensions/Voting/Extension.pm index 2fd7d2e22..a46162ed2 100644 --- a/extensions/Voting/Extension.pm +++ b/extensions/Voting/Extension.pm @@ -276,7 +276,7 @@ sub sanitycheck_check { my $needs_rebuild; foreach my $id (keys %cached_counts) { my $cached_count = $cached_counts{$id}; - my $real_count = $real_counts{$id} || 0; + my $real_count = $real_counts{$id} || 0; if ($cached_count < 0) { $status->('voting_count_alert', {id => $id}, 'alert'); } @@ -447,7 +447,7 @@ sub _page_user { ($who->id, $product->id) ); - my %votes = map { $_->[0] => $_->[1] } @$vote_list; + my %votes = map { $_->[0] => $_->[1] } @$vote_list; my @bug_ids = sort keys %votes; # Exclude bugs that the user can no longer see. @@ -878,7 +878,7 @@ sub _remove_votes { # If a user votes for a bug, or the number of votes required to # confirm a bug has been reduced, check if the bug is now confirmed. sub _confirm_if_vote_confirmed { - my $id = shift; + my $id = shift; my $bug = ref $id ? $id : new Bugzilla::Bug({id => $id, cache => 1}); my $ret = 0; diff --git a/importxml.pl b/importxml.pl index 50d1d9de9..96264cb0a 100755 --- a/importxml.pl +++ b/importxml.pl @@ -623,7 +623,7 @@ sub process_bug { $err .= " Using default product and component set "; $err .= "at the command line.\n"; - $product = new Bugzilla::Product({name => $default_product_name}); + $product = new Bugzilla::Product({name => $default_product_name}); $component = new Bugzilla::Component( {name => $default_component_name, product => $product}); if (!$component) { @@ -1084,7 +1084,7 @@ sub process_bug { $query .= ")"; $dbh->do($query, undef, @values); - my $id = $dbh->bz_last_key('bugs', 'bug_id'); + my $id = $dbh->bz_last_key('bugs', 'bug_id'); my $bug_obj = Bugzilla::Bug->new($id); # We are almost certain to get some uninitialized warnings diff --git a/post_bug.cgi b/post_bug.cgi index 6428f5892..757db7fdf 100755 --- a/post_bug.cgi +++ b/post_bug.cgi @@ -216,7 +216,7 @@ $vars->{'bug'} = $bug; Bugzilla::Hook::process('post_bug_after_creation', {vars => $vars}); my $recipients = {changer => $user}; -my $bug_sent = Bugzilla::BugMail::Send($id, $recipients); +my $bug_sent = Bugzilla::BugMail::Send($id, $recipients); $bug_sent->{type} = 'created'; $bug_sent->{id} = $id; my @all_mail_results = ($bug_sent); diff --git a/quips.cgi b/quips.cgi index 6378bd615..671ec1f09 100755 --- a/quips.cgi +++ b/quips.cgi @@ -27,7 +27,7 @@ my $template = Bugzilla->template; my $vars = {}; my $action = $cgi->param('action') || ""; -my $token = $cgi->param('token'); +my $token = $cgi->param('token'); if ($action eq "show") { diff --git a/relogin.cgi b/relogin.cgi index 8fefe5daa..2cd9bb25c 100755 --- a/relogin.cgi +++ b/relogin.cgi @@ -100,7 +100,7 @@ elsif ($action eq 'begin-sudo') { my $user = Bugzilla->login(LOGIN_REQUIRED); my $target_login = $cgi->param('target_login'); - my $reason = $cgi->param('reason') || ''; + my $reason = $cgi->param('reason') || ''; # At this point, the user is logged in. However, if they used a method # where they could have provided a username/password (i.e. CGI), but they diff --git a/report.cgi b/report.cgi index ed6d1ad33..7895115b3 100755 --- a/report.cgi +++ b/report.cgi @@ -41,7 +41,7 @@ if (grep(/^cmd-/, $cgi->param())) { Bugzilla->login(); my $action = $cgi->param('action') || 'menu'; -my $token = $cgi->param('token'); +my $token = $cgi->param('token'); if ($action eq "menu") { diff --git a/reports.cgi b/reports.cgi index a88a4332e..860a537d8 100755 --- a/reports.cgi +++ b/reports.cgi @@ -57,7 +57,7 @@ if (!defined($product_id)) { foreach my $dataset (@data) { my $datasets = {}; - $datasets->{'value'} = $dataset; + $datasets->{'value'} = $dataset; $datasets->{'selected'} = $default_sel{$dataset} ? 1 : 0; push(@datasets, $datasets); } @@ -94,9 +94,9 @@ else { # Filenames must not be guessable as they can point to products # you are not allowed to see. Also, different projects can have # the same product IDs. - my $project = bz_locations()->{'project'} || ''; + my $project = bz_locations()->{'project'} || ''; my $image_file = join(':', ($project, $product->id, @datasets)); - my $key = Bugzilla->localconfig->{'site_wide_secret'}; + my $key = Bugzilla->localconfig->{'site_wide_secret'}; $image_file = hmac_sha256_base64($image_file, $key) . '.png'; $image_file =~ s/\+/-/g; $image_file =~ s/\//_/g; @@ -146,7 +146,7 @@ sub generate_chart { my $product_in_title = $product->id ? $product->name : 'All Products'; my @fields; - my @labels = qw(DATE); + my @labels = qw(DATE); my %datasets = map { $_ => 1 } @$datasets; my %data = (); @@ -198,7 +198,7 @@ sub generate_chart { } my $img = Chart::Lines->new(800, 600); - my $i = 0; + my $i = 0; my $MAXTICKS = 20; # Try not to show any more x ticks than this. my $skip = 1; diff --git a/request.cgi b/request.cgi index aad0dee1c..97978ccad 100755 --- a/request.cgi +++ b/request.cgi @@ -54,7 +54,7 @@ if ($action eq 'queue') { } else { my $flagtypes = get_flag_types(); - my @types = ('all', @$flagtypes); + my @types = ('all', @$flagtypes); my $vars = {}; $vars->{'types'} = \@types; diff --git a/sanitycheck.cgi b/sanitycheck.cgi index 737f2ef89..3d4334e93 100755 --- a/sanitycheck.cgi +++ b/sanitycheck.cgi @@ -104,14 +104,12 @@ if ($cgi->param('createmissinggroupcontrolmapentries')) { my $na = CONTROLMAPNA; my $shown = CONTROLMAPSHOWN; - my $insertsth = $dbh->prepare( - qq{INSERT INTO group_control_map + my $insertsth = $dbh->prepare(qq{INSERT INTO group_control_map (group_id, product_id, membercontrol, othercontrol) VALUES (?, ?, $shown, $na)} ); - my $updatesth = $dbh->prepare( - qq{UPDATE group_control_map + my $updatesth = $dbh->prepare(qq{UPDATE group_control_map SET membercontrol = $shown WHERE group_id = ? AND product_id = ?} @@ -251,8 +249,7 @@ if ($cgi->param('rescanallBugMail')) { Status('send_bugmail_start'); my $time = $dbh->sql_date_math('NOW()', '-', 30, 'MINUTE'); - my $list = $dbh->selectcol_arrayref( - qq{ + my $list = $dbh->selectcol_arrayref(qq{ SELECT bug_id FROM bugs WHERE (lastdiffed IS NULL @@ -742,8 +739,7 @@ sub check_keywords { Status('keyword_check_start'); my %keywordids; - my $keywords = $dbh->selectall_arrayref( - q{SELECT id, name + my $keywords = $dbh->selectall_arrayref(q{SELECT id, name FROM keyworddefs} ); @@ -758,8 +754,7 @@ sub check_keywords { } } - my $sth = $dbh->prepare( - q{SELECT bug_id, keywordid + my $sth = $dbh->prepare(q{SELECT bug_id, keywordid FROM keywords ORDER BY bug_id, keywordid} ); @@ -860,8 +855,7 @@ sub BugCheck { my ($middlesql, $errortext, $repairparam, $repairtext) = @_; my $dbh = Bugzilla->dbh; - my $badbugs = $dbh->selectcol_arrayref( - qq{SELECT DISTINCT bugs.bug_id + my $badbugs = $dbh->selectcol_arrayref(qq{SELECT DISTINCT bugs.bug_id FROM $middlesql ORDER BY bugs.bug_id} ); @@ -995,9 +989,8 @@ BugCheck( Status('unsent_bugmail_check'); -my $time = $dbh->sql_date_math('NOW()', '-', 30, 'MINUTE'); -my $badbugs = $dbh->selectcol_arrayref( - qq{ +my $time = $dbh->sql_date_math('NOW()', '-', 30, 'MINUTE'); +my $badbugs = $dbh->selectcol_arrayref(qq{ SELECT bug_id FROM bugs WHERE (lastdiffed IS NULL OR lastdiffed < delta_ts) diff --git a/show_bug.cgi b/show_bug.cgi index bc5a104a3..64a99d11b 100755 --- a/show_bug.cgi +++ b/show_bug.cgi @@ -99,7 +99,7 @@ else { Bugzilla::Bug->preload(\@bugs); -$vars->{'bugs'} = [@bugs, @illegal_bugs]; +$vars->{'bugs'} = [@bugs, @illegal_bugs]; $vars->{'marks'} = \%marks; my @bugids = map { $_->bug_id } grep { !$_->error } @bugs; diff --git a/showdependencygraph.cgi b/showdependencygraph.cgi index dac0c1900..666a6626e 100755 --- a/showdependencygraph.cgi +++ b/showdependencygraph.cgi @@ -108,7 +108,7 @@ if (!grep { $_ eq $rankdir } @valid_rankdirs) { $rankdir = 'TB'; } -my $display = $cgi->param('display') || 'tree'; +my $display = $cgi->param('display') || 'tree'; my $webdotdir = bz_locations()->{'webdotdir'}; my ($fh, $filename) = File::Temp::tempfile( @@ -139,8 +139,7 @@ foreach my $i (split('[\s,]+', $cgi->param('id'))) { my @stack = keys(%baselist); if ($display eq 'web') { - my $sth = $dbh->prepare( - q{SELECT blocked, dependson + my $sth = $dbh->prepare(q{SELECT blocked, dependson FROM dependencies WHERE blocked = ? OR dependson = ?} ); @@ -184,8 +183,7 @@ foreach my $k (keys(%baselist)) { $seen{$k} = 1; } -my $sth = $dbh->prepare( - q{SELECT bug_status, resolution, short_desc +my $sth = $dbh->prepare(q{SELECT bug_status, resolution, short_desc FROM bugs WHERE bugs.bug_id = ?} ); diff --git a/showdependencytree.cgi b/showdependencytree.cgi index 501c47621..94ac15107 100755 --- a/showdependencytree.cgi +++ b/showdependencytree.cgi @@ -53,7 +53,7 @@ local our $realdepth = 0; # Generate the tree of bugs that this bug depends on and a list of IDs # appearing in the tree. my $dependson_tree = {$id => $bug}; -my $dependson_ids = {}; +my $dependson_ids = {}; GenerateTree($id, "dependson", 1, $dependson_tree, $dependson_ids); $vars->{'dependson_tree'} = $dependson_tree; $vars->{'dependson_ids'} = [keys(%$dependson_ids)]; @@ -61,7 +61,7 @@ $vars->{'dependson_ids'} = [keys(%$dependson_ids)]; # Generate the tree of bugs that this bug blocks and a list of IDs # appearing in the tree. my $blocked_tree = {$id => $bug}; -my $blocked_ids = {}; +my $blocked_ids = {}; GenerateTree($id, "blocked", 1, $blocked_tree, $blocked_ids); $vars->{'blocked_tree'} = $blocked_tree; $vars->{'blocked_ids'} = [keys(%$blocked_ids)]; diff --git a/summarize_time.cgi b/summarize_time.cgi index 9dbe03db3..9f4e658f3 100755 --- a/summarize_time.cgi +++ b/summarize_time.cgi @@ -172,7 +172,7 @@ sub sqlize_dates { sub get_blocker_ids { my ($bug_id, $unique) = @_; $unique ||= {$bug_id => 1}; - my $deps = Bugzilla::Bug::EmitDependList("blocked", "dependson", $bug_id); + my $deps = Bugzilla::Bug::EmitDependList("blocked", "dependson", $bug_id); my @unseen = grep { !$unique->{$_}++ } @$deps; foreach $bug_id (@unseen) { get_blocker_ids($bug_id, $unique); diff --git a/t/001compile.t b/t/001compile.t index bfd065dc0..ad29975af 100644 --- a/t/001compile.t +++ b/t/001compile.t @@ -62,7 +62,7 @@ sub compile_file { ok(!$return_val, $file) or diag('--ERROR'); } -my @testitems = (@Support::Files::testitems, @Support::Files::test_files); +my @testitems = (@Support::Files::testitems, @Support::Files::test_files); my $file_features = map_files_to_features(); # Test the scripts by compiling them diff --git a/t/002goodperl.t b/t/002goodperl.t index c59692229..837849282 100644 --- a/t/002goodperl.t +++ b/t/002goodperl.t @@ -22,7 +22,7 @@ use Test::More tests => (scalar(@Support::Files::testitems) + scalar(@Support::Files::test_files)) * 6; -my @testitems = (@Support::Files::test_files, @Support::Files::testitems); +my @testitems = (@Support::Files::test_files, @Support::Files::testitems); my @require_taint = qw(email_in.pl importxml.pl mod_perl.pl whine.pl); foreach my $file (@testitems) { diff --git a/t/012throwables.t b/t/012throwables.t index 3cfa211dc..6b092d8c2 100644 --- a/t/012throwables.t +++ b/t/012throwables.t @@ -45,7 +45,7 @@ foreach my $module (@Support::Files::testitems) { foreach my $include_path (@include_paths) { foreach my $path (@{$actual_files{$include_path}}) { my $file = File::Spec->catfile($include_path, $path); - $file =~ s/\s.*$//; # nuke everything after the first space + $file =~ s/\s.*$//; # nuke everything after the first space $file =~ s|\\|/|g if ON_WINDOWS; # convert \ to / in path if on windows $test_templates{$file} = () if $file =~ m#global/(code|user)-error\.html\.tmpl#; diff --git a/testserver.pl b/testserver.pl index db88f7c0f..3c01a550e 100755 --- a/testserver.pl +++ b/testserver.pl @@ -145,7 +145,7 @@ if ($@ eq '') { my $verstring = "GD version $gd, libgd version $gdlib"; $gdlib =~ s/^([^\.]+)\..*/$1/; - $gd =~ s/^([^\.]+)\..*/$1/; + $gd =~ s/^([^\.]+)\..*/$1/; if ($gdlib == $gd) { say "TEST-OK $verstring; Major versions match."; @@ -159,10 +159,10 @@ if ($@ eq '') { # Test GD eval { my $image = new GD::Image(100, 100); - my $black = $image->colorAllocate(0, 0, 0); + my $black = $image->colorAllocate(0, 0, 0); my $white = $image->colorAllocate(255, 255, 255); - my $red = $image->colorAllocate(255, 0, 0); - my $blue = $image->colorAllocate(0, 0, 255); + my $red = $image->colorAllocate(255, 0, 0); + my $blue = $image->colorAllocate(0, 0, 255); $image->transparent($white); $image->rectangle(0, 0, 99, 99, $black); $image->arc(50, 50, 95, 75, 0, 360, $blue); diff --git a/userprefs.cgi b/userprefs.cgi index 17be0cc8f..4c2ad1f15 100755 --- a/userprefs.cgi +++ b/userprefs.cgi @@ -300,7 +300,7 @@ sub SaveEmail { # The new information given to us by the user. my $new_watched_users = join(',', $cgi->param('new_watchedusers')) || ''; - my @new_watch_names = split(/[,\s]+/, $new_watched_users); + my @new_watch_names = split(/[,\s]+/, $new_watched_users); my %new_watch_ids; foreach my $username (@new_watch_names) { @@ -541,7 +541,7 @@ sub DoApiKey { my $user = Bugzilla->user; my $api_keys = Bugzilla::User::APIKey->match({user_id => $user->id}); - $vars->{api_keys} = $api_keys; + $vars->{api_keys} = $api_keys; $vars->{any_revoked} = grep { $_->revoked } @$api_keys; } diff --git a/votes.cgi b/votes.cgi index 2d8a11f83..83f36dc6b 100755 --- a/votes.cgi +++ b/votes.cgi @@ -21,7 +21,7 @@ use Bugzilla::Error; my $is_enabled = grep { $_->NAME eq 'Voting' } @{Bugzilla->extensions}; $is_enabled || ThrowUserError('extension_disabled', {name => 'Voting'}); -my $cgi = Bugzilla->cgi; +my $cgi = Bugzilla->cgi; my $action = $cgi->param('action') || 'show_user'; if ($action eq "show_bug") { diff --git a/whine.pl b/whine.pl index 67faaeaf2..691df886f 100755 --- a/whine.pl +++ b/whine.pl @@ -253,7 +253,7 @@ sub get_next_event { my $sth = $dbh->prepare("SELECT name FROM groups " . "WHERE id=?"); $sth->execute($mailto); my $groupname = $sth->fetch->[0]; - my $group_id = Bugzilla::Group::ValidateGroupName($groupname, $owner); + my $group_id = Bugzilla::Group::ValidateGroupName($groupname, $owner); if ($group_id) { my $glist = join(',', @{Bugzilla::Group->flatten_group_membership($group_id)}); $sth = $dbh->prepare( @@ -417,7 +417,7 @@ sub run_queries { push @{$thisquery->{'columnlist'}}, @searchfields; my @orderstrings = split(/,\s*/, $searchparams->param('order') || ''); - my $search = new Bugzilla::Search( + my $search = new Bugzilla::Search( 'fields' => \@searchfields, 'params' => scalar $searchparams->Vars, 'user' => $args->{'recipient'}, # the search runs as the recipient @@ -628,7 +628,7 @@ sub get_next_date { # if it's today if ($daysinmonth[$now_month] == $now_day) { my $month = $now_month + 1; - $month = 1 if $month > 12; + $month = 1 if $month > 12; $add_days = $daysinmonth[$month] + 1; } else { diff --git a/xt/lib/Bugzilla/Test/Search.pm b/xt/lib/Bugzilla/Test/Search.pm index 95784c7a2..9d8425cf2 100644 --- a/xt/lib/Bugzilla/Test/Search.pm +++ b/xt/lib/Bugzilla/Test/Search.pm @@ -486,7 +486,7 @@ sub _create_field_values { foreach my $field (@multi_selects) { my $new_value = create_legal_value($field, 6); - my $name = $field->name; + my $name = $field->name; $values{$name} = [$values{$name}, $new_value->name]; } push(@{$values{'tag'}}, "6-tag-" . random()); @@ -607,7 +607,7 @@ sub _create_one_bug { # We need bug 6 to have a unique alias that is not a clone of bug 1's, # so we get the alias separately from the other parameters. - my $alias = $self->bug_create_value($number, 'alias'); + my $alias = $self->bug_create_value($number, 'alias'); my $update_alias = $self->bug_update_value($number, 'alias'); # Otherwise, make bug 6 a clone of bug 1. @@ -635,11 +635,9 @@ sub _create_one_bug { # These are necessary for the changedfrom tests. my $extra_values = $self->_extra_bug_create_values->{$number}; - foreach my $field ( - qw(comments remaining_time percentage_complete + foreach my $field (qw(comments remaining_time percentage_complete keyword_objects everconfirmed dependson blocked - groups_in classification actual_time) - ) + groups_in classification actual_time)) { $extra_values->{$field} = $bug->$field; } @@ -675,7 +673,7 @@ sub _create_one_bug { # writing this test, Bug->create doesn't support setting resolution). # # Same for see_also. - my $timestamp = timestamp($number, $number - 1); + my $timestamp = timestamp($number, $number - 1); my $creation_ts = $timestamp->ymd . ' ' . $timestamp->hms; $bug->{creation_ts} = $creation_ts; $dbh->do('UPDATE longdescs SET bug_when = ? WHERE bug_id = ?', @@ -748,8 +746,8 @@ sub _create_one_bug { $update_params{cc} = {add => \@cc_add, remove => \@cc_remove}; my $see_also_remove = $bug->see_also; my $see_also_add = [$update_params{see_also}]; - $update_params{see_also} = {add => $see_also_add, remove => $see_also_remove}; - $update_params{comment} = {body => $update_params{comment}}; + $update_params{see_also} = {add => $see_also_add, remove => $see_also_remove}; + $update_params{comment} = {body => $update_params{comment}}; $update_params{work_time} = $number; # Setting work_time kills the remaining_time, so we need to @@ -944,7 +942,7 @@ sub run { } # Rollbacks won't get rid of bugs_fulltext entries, so we do that ourselves. - my @bug_ids = map { $_->id } $self->bugs; + my @bug_ids = map { $_->id } $self->bugs; my $bug_id_string = join(',', @bug_ids); $dbh->do("DELETE FROM bugs_fulltext WHERE bug_id IN ($bug_id_string)"); $dbh->bz_rollback_transaction(); @@ -969,7 +967,7 @@ sub _setup_dependencies { my $bug2 = $self->bug(2); my $bug3 = $self->bug(3); foreach my $number (1, 6) { - my $bug = $self->bug($number); + my $bug = $self->bug($number); my @original_delta = ($bug2->delta_ts, $bug3->delta_ts); Bugzilla->set_user($bug->reporter); $bug->set_dependencies([$bug2->id], [$bug3->id]); diff --git a/xt/lib/Bugzilla/Test/Search/Constants.pm b/xt/lib/Bugzilla/Test/Search/Constants.pm index 5ff9bd4a9..84080cfe8 100644 --- a/xt/lib/Bugzilla/Test/Search/Constants.pm +++ b/xt/lib/Bugzilla/Test/Search/Constants.pm @@ -957,13 +957,11 @@ use constant INJECTION_BROKEN_FIELD => { 'longdescs.count' => { search => 1, db_skip => ['Pg'], - operator_ok => [ - qw(allwords allwordssubstr anywordssubstr casesubstring + operator_ok => [qw(allwords allwordssubstr anywordssubstr casesubstring changedbefore changedafter greaterthan greaterthaneq lessthan lessthaneq notregexp notsubstring nowordssubstr regexp substring anywords - notequals nowords equals anyexact) - ], + notequals nowords equals anyexact)], }, }; diff --git a/xt/lib/Bugzilla/Test/Search/CustomTest.pm b/xt/lib/Bugzilla/Test/Search/CustomTest.pm index 7423ae367..7455d4828 100644 --- a/xt/lib/Bugzilla/Test/Search/CustomTest.pm +++ b/xt/lib/Bugzilla/Test/Search/CustomTest.pm @@ -70,7 +70,7 @@ sub invalid_field_operator_combination { return undef } sub search_params { my ($self) = @_; - my %params = %{$self->test->{top_params} || {}}; + my %params = %{$self->test->{top_params} || {}}; my $counter = 0; foreach my $row (@{$self->test->{params}}) { $row->{v} = $self->translate_value($row) if exists $row->{v}; diff --git a/xt/lib/Bugzilla/Test/Search/FieldTest.pm b/xt/lib/Bugzilla/Test/Search/FieldTest.pm index 19ceb8d5c..2ccaab735 100644 --- a/xt/lib/Bugzilla/Test/Search/FieldTest.pm +++ b/xt/lib/Bugzilla/Test/Search/FieldTest.pm @@ -158,7 +158,7 @@ sub translated_value { sub debug_fail { my ($self, $number, $results, $sql) = @_; my @expected = @{$self->test->{contains}}; - my @results = sort map { $self->number($_) } map { $_->[0] } @$results; + my @results = sort map { $self->number($_) } map { $_->[0] } @$results; return " Value: '" . $self->translated_value . "'\n" @@ -354,7 +354,7 @@ sub _field_values_for_bug { if ($field =~ /^attach.+\.(.+)$/) { my $attach_field = $1; $attach_field = ATTACHMENT_FIELDS->{$attach_field} || $attach_field; - @values = $self->_values_for($number, 'attachments', $attach_field); + @values = $self->_values_for($number, 'attachments', $attach_field); } elsif (my $flag_field = FLAG_FIELDS->{$field}) { @values = $self->_values_for($number, 'flags', $flag_field); @@ -410,7 +410,7 @@ sub _field_values_for_bug { # requestees.login_name is empty for most bugs (but checking # blessed(undef) handles that. # Values that come from %original_values aren't User objects. - @values = map { blessed($_) ? $_->login : $_ } @values; + @values = map { blessed($_) ? $_->login : $_ } @values; @values = grep { defined $_ } @values; } @@ -503,7 +503,7 @@ sub _translate_value_for_bug { } if (my $func = $self->test->{transform}) { my $transformed = $func->(@bug_values); - my $is_equal = $transformed eq $bug_values[0] ? 1 : 0; + my $is_equal = $transformed eq $bug_values[0] ? 1 : 0; $self->transformed_value_was_equal($number, $is_equal); $string_value = $transformed; } @@ -619,7 +619,7 @@ sub _test_content_for_bug { my $contains_known_broken = $self->contains_known_broken($number); my %result_ids = map { $_->[0] => 1 } @$results; - my $bug_id = $self->bug($number)->id; + my $bug_id = $self->bug($number)->id; TODO: { local $TODO = $contains_known_broken if $contains_known_broken; diff --git a/xt/lib/Bugzilla/Test/Search/OrTest.pm b/xt/lib/Bugzilla/Test/Search/OrTest.pm index 32af7dac4..ebb16089d 100644 --- a/xt/lib/Bugzilla/Test/Search/OrTest.pm +++ b/xt/lib/Bugzilla/Test/Search/OrTest.pm @@ -21,7 +21,7 @@ use constant type => 'OR'; sub new { my $class = shift; - my $self = {field_tests => [@_]}; + my $self = {field_tests => [@_]}; return bless $self, $class; } -- cgit v1.2.3-65-gdbad From 3d061531a3f9c6a73da857f8b91282ad78243d76 Mon Sep 17 00:00:00 2001 From: Dylan William Hardison Date: Mon, 4 Feb 2019 19:51:53 -0500 Subject: Bug 1526703 - Increase the size of the flagtype id column --- Bugzilla/DB/Schema.pm | 8 ++++---- Bugzilla/Install/DB.pm | 29 ++++++++++++++++++++++++++--- 2 files changed, 30 insertions(+), 7 deletions(-) diff --git a/Bugzilla/DB/Schema.pm b/Bugzilla/DB/Schema.pm index 0ca4a386f..94b8734f3 100644 --- a/Bugzilla/DB/Schema.pm +++ b/Bugzilla/DB/Schema.pm @@ -626,7 +626,7 @@ use constant ABSTRACT_SCHEMA => { FIELDS => [ id => {TYPE => 'MEDIUMSERIAL', NOTNULL => 1, PRIMARYKEY => 1}, type_id => { - TYPE => 'INT2', + TYPE => 'INT3', NOTNULL => 1, REFERENCES => {TABLE => 'flagtypes', COLUMN => 'id', DELETE => 'CASCADE'} }, @@ -662,7 +662,7 @@ use constant ABSTRACT_SCHEMA => { # "flagtypes" defines the types of flags that can be set. flagtypes => { FIELDS => [ - id => {TYPE => 'SMALLSERIAL', NOTNULL => 1, PRIMARYKEY => 1}, + id => {TYPE => 'MEDIUMSERIAL', NOTNULL => 1, PRIMARYKEY => 1}, name => {TYPE => 'varchar(50)', NOTNULL => 1}, description => {TYPE => 'MEDIUMTEXT', NOTNULL => 1}, cc_list => {TYPE => 'varchar(200)'}, @@ -689,7 +689,7 @@ use constant ABSTRACT_SCHEMA => { flaginclusions => { FIELDS => [ type_id => { - TYPE => 'INT2', + TYPE => 'INT3', NOTNULL => 1, REFERENCES => {TABLE => 'flagtypes', COLUMN => 'id', DELETE => 'CASCADE'} }, @@ -711,7 +711,7 @@ use constant ABSTRACT_SCHEMA => { flagexclusions => { FIELDS => [ type_id => { - TYPE => 'INT2', + TYPE => 'INT3', NOTNULL => 1, REFERENCES => {TABLE => 'flagtypes', COLUMN => 'id', DELETE => 'CASCADE'} }, diff --git a/Bugzilla/Install/DB.pm b/Bugzilla/Install/DB.pm index ff04fe794..ab71a5334 100644 --- a/Bugzilla/Install/DB.pm +++ b/Bugzilla/Install/DB.pm @@ -475,9 +475,8 @@ sub update_table_definitions { $dbh->bz_drop_column('profiles', 'refreshed_when'); $dbh->bz_drop_column('groups', 'last_changed'); - # 2006-08-06 LpSolit@gmail.com - Bug 347521 - $dbh->bz_alter_column('flagtypes', 'id', - {TYPE => 'SMALLSERIAL', NOTNULL => 1, PRIMARYKEY => 1}); + # 2019-01-31 dylan@hardison.net - Bug TODO + _update_flagtypes_id(); $dbh->bz_alter_column('keyworddefs', 'id', {TYPE => 'SMALLSERIAL', NOTNULL => 1, PRIMARYKEY => 1}); @@ -820,6 +819,30 @@ sub _update_product_name_definition { } } +sub _update_flagtypes_id { + my $dbh = Bugzilla->dbh; + my @fixes = ( + {table => 'flaginclusions', column => 'type_id'}, + {table => 'flagexclusions', column => 'type_id'}, + {table => 'flags', column => 'type_id'}, + ); + my $flagtypes_def = $dbh->bz_column_info('flagtypes', 'id'); + foreach my $fix (@fixes) { + my $def = $dbh->bz_column_info($fix->{table}, $fix->{column}); + if ($def->{TYPE} eq 'INT2') { + warn "Dropping $fix->{table}\n"; + $dbh->bz_drop_related_fks($fix->{table}, $fix->{column}); + $def->{TYPE} = 'INT3'; + $dbh->bz_alter_column($fix->{table}, $fix->{column}, $def); + } + } + + if ($flagtypes_def->{TYPE} eq 'SMALLSERIAL') { + $flagtypes_def->{TYPE} = 'MEDIUMSERIAL'; + $dbh->bz_alter_column('flagtypes', 'id', $flagtypes_def); + } +} + # A helper for the function below. sub _write_one_longdesc { my ($id, $who, $when, $buffer) = (@_); -- cgit v1.2.3-65-gdbad From e59bafbe0d6bade76b620f58eb91eab0409bb198 Mon Sep 17 00:00:00 2001 From: Dylan William Hardison Date: Sat, 9 Feb 2019 16:01:45 -0500 Subject: bump version and add release notes for 5.0.6 --- Bugzilla/Constants.pm | 2 +- template/en/default/pages/release-notes.html.tmpl | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Bugzilla/Constants.pm b/Bugzilla/Constants.pm index ca8787170..a9a5e0eaa 100644 --- a/Bugzilla/Constants.pm +++ b/Bugzilla/Constants.pm @@ -200,7 +200,7 @@ use Memoize; # CONSTANTS # # Bugzilla version -use constant BUGZILLA_VERSION => "5.0.4+"; +use constant BUGZILLA_VERSION => "5.0.6"; # A base link to the current REST Documentation. We place it here # as it will need to be updated to whatever the current release is. diff --git a/template/en/default/pages/release-notes.html.tmpl b/template/en/default/pages/release-notes.html.tmpl index d1380b067..fd6c9e00d 100644 --- a/template/en/default/pages/release-notes.html.tmpl +++ b/template/en/default/pages/release-notes.html.tmpl @@ -43,6 +43,10 @@

Updates in this 5.0.x Release

+

5.0.6

+

This release contains a schema change to the flagtypes table, allowing for many more flagtypes.

. +

The flagtypes table should have been using a mediumint for several releases, but due to a bug in the schema migration code this never happened.

+

5.0.5

This release reformats the code according to the same conventions as the popular Mojolicious product and includes a .perltidyrc to do the same. -- cgit v1.2.3-65-gdbad