From 2545c0950c4f0fde8f78b265217fa9f523eff7bf Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Tue, 20 Jun 2006 03:15:17 +0000 Subject: Bug 304601: Bugzilla::Config's :locations exports need to be in their own module - Patch by Frédéric Buclin r=mkanat for the main patch, r=myk for the patch about CGI.pm a=justdave MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug 328637: Remove all legal_* versioncache arrays - Patch by Frédéric Buclin r=mkanat a=justdave Bug 110503 - Eliminate versioncache --- importxml.pl | 48 +++++++----------------------------------------- 1 file changed, 7 insertions(+), 41 deletions(-) (limited to 'importxml.pl') diff --git a/importxml.pl b/importxml.pl index dad82b17d..6faa172e3 100755 --- a/importxml.pl +++ b/importxml.pl @@ -86,6 +86,7 @@ use Bugzilla::User; use Bugzilla::Util; use Bugzilla::Constants; use Bugzilla::Keyword; +use Bugzilla::Field; use MIME::Base64; use MIME::Parser; @@ -116,7 +117,6 @@ use constant OK_LEVEL => 3; use constant DEBUG_LEVEL => 2; use constant ERR_LEVEL => 1; -GetVersionTable(); our @logs; our @attachments; our $bugtotal; @@ -128,19 +128,6 @@ my ($timestamp) = $dbh->selectrow_array("SELECT NOW()"); # Helper sub routines # ############################################################################### -# This can go away as soon as data/versioncache is removed. Since we still -# have to use GetVersionTable() though, it stays for now. - -sub sillyness { - my $zz; - $zz = @::legal_bug_status; - $zz = @::legal_opsys; - $zz = @::legal_platform; - $zz = @::legal_priority; - $zz = @::legal_severity; - $zz = @::legal_resolution; -} - sub MailMessage { return unless ($mail); my $subject = shift; @@ -180,27 +167,6 @@ sub Error { exit; } -# This will be implemented in Bugzilla::Field as soon as bug 31506 lands -sub check_field { - my ($name, $value, $legalsRef, $no_warn) = @_; - my $dbh = Bugzilla->dbh; - - if (!defined($value) - || trim($value) eq "" - || (defined($legalsRef) && lsearch($legalsRef, $value) < 0)) - { - return 0 if $no_warn; # We don't want an error to be thrown; return. - - trick_taint($name); - my ($result) = $dbh->selectrow_array("SELECT description FROM fielddefs - WHERE name = ?", undef, $name); - - my $field = $result || $name; - ThrowCodeError('illegal_field', { field => $field }); - } - return 1; -} - # This subroutine handles flags for process_bug. It is generic in that # it can handle both attachment flags and bug flags. sub flag_handler { @@ -741,7 +707,7 @@ sub process_bug { # imported is valid. If it is not we use the defaults set in the parameters. if (defined( $bug_fields{'bug_severity'} ) && check_field('bug_severity', scalar $bug_fields{'bug_severity'}, - \@::legal_severity, ERR_LEVEL) ) + undef, ERR_LEVEL) ) { push( @values, $bug_fields{'bug_severity'} ); } @@ -758,7 +724,7 @@ sub process_bug { if (defined( $bug_fields{'priority'} ) && check_field('priority', scalar $bug_fields{'priority'}, - \@::legal_priority, ERR_LEVEL ) ) + undef, ERR_LEVEL ) ) { push( @values, $bug_fields{'priority'} ); } @@ -775,7 +741,7 @@ sub process_bug { if (defined( $bug_fields{'rep_platform'} ) && check_field('rep_platform', scalar $bug_fields{'rep_platform'}, - \@::legal_platform, ERR_LEVEL ) ) + undef, ERR_LEVEL ) ) { push( @values, $bug_fields{'rep_platform'} ); } @@ -792,7 +758,7 @@ sub process_bug { if (defined( $bug_fields{'op_sys'} ) && check_field('op_sys', scalar $bug_fields{'op_sys'}, - \@::legal_opsys, ERR_LEVEL ) ) + undef, ERR_LEVEL ) ) { push( @values, $bug_fields{'op_sys'} ); } @@ -898,10 +864,10 @@ sub process_bug { my $has_status = defined($bug_fields{'bug_status'}); my $valid_res = check_field('resolution', scalar $bug_fields{'resolution'}, - \@::legal_resolution, ERR_LEVEL ); + undef, ERR_LEVEL ); my $valid_status = check_field('bug_status', scalar $bug_fields{'bug_status'}, - \@::legal_bug_status, ERR_LEVEL ); + undef, ERR_LEVEL ); my $is_open = is_open_state($bug_fields{'bug_status'}); my $status = $bug_fields{'bug_status'} || undef; my $resolution = $bug_fields{'resolution'} || undef; -- cgit v1.2.3-24-g4f1b