From 6c16eddbad9bcef7d7b2d51dc274451a152524fe Mon Sep 17 00:00:00 2001 From: "mkanat%kerio.com" <> Date: Fri, 3 Mar 2006 07:50:13 +0000 Subject: Bug 328602: Eliminate %::versions and @::legal_versions Patch By Max Kanat-Alexander r=LpSolit, a=myk --- post_bug.cgi | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'post_bug.cgi') diff --git a/post_bug.cgi b/post_bug.cgi index 50ef6ecef..3e589ebe8 100755 --- a/post_bug.cgi +++ b/post_bug.cgi @@ -33,13 +33,13 @@ use Bugzilla::Util; use Bugzilla::Bug; use Bugzilla::User; use Bugzilla::Field; +use Bugzilla::Product; # Shut up misguided -w warnings about "used only once". For some reason, # "use vars" chokes on me when I try it here. sub sillyness { my $zz; $zz = %::components; - $zz = %::versions; $zz = @::legal_opsys; $zz = @::legal_platform; $zz = @::legal_priority; @@ -100,7 +100,8 @@ ValidateComment($comment); my $product = $cgi->param('product'); $user->can_enter_product($product, 1); -my $product_id = get_product_id($product); +my $prod_obj = new Bugzilla::Product({name => $product}); +my $product_id = $prod_obj->id; # Set cookies if (defined $cgi->param('product')) { @@ -223,7 +224,8 @@ check_field('bug_severity', scalar $cgi->param('bug_severity'), \@::legal_severi check_field('priority', scalar $cgi->param('priority'), \@::legal_priority); check_field('op_sys', scalar $cgi->param('op_sys'), \@::legal_opsys); check_field('bug_status', scalar $cgi->param('bug_status'), ['UNCONFIRMED', 'NEW']); -check_field('version', scalar $cgi->param('version'), $::versions{$product}); +check_field('version', scalar $cgi->param('version'), + [map($_->name, @{$prod_obj->versions})]); check_field('component', scalar $cgi->param('component'), $::components{$product}); check_field('target_milestone', scalar $cgi->param('target_milestone'), $::target_milestone{$product}); -- cgit v1.2.3-24-g4f1b