summaryrefslogtreecommitdiffstats
path: root/post_bug.cgi
diff options
context:
space:
mode:
authormkanat%kerio.com <>2006-03-03 08:50:13 +0100
committermkanat%kerio.com <>2006-03-03 08:50:13 +0100
commit6c16eddbad9bcef7d7b2d51dc274451a152524fe (patch)
tree7a153e2f238420fc777d5f7d13cad910f5f54742 /post_bug.cgi
parent975b2688b862a89f302a77b9a42c8f794fed13a8 (diff)
downloadbugzilla-6c16eddbad9bcef7d7b2d51dc274451a152524fe.tar.gz
bugzilla-6c16eddbad9bcef7d7b2d51dc274451a152524fe.tar.xz
Bug 328602: Eliminate %::versions and @::legal_versions
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=myk
Diffstat (limited to 'post_bug.cgi')
-rwxr-xr-xpost_bug.cgi8
1 files changed, 5 insertions, 3 deletions
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});