From 0d2869cdc8bf59db57e80e7e3a0c0c377fc0ffb5 Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Sun, 18 Jun 2006 06:12:35 +0000 Subject: Bug 338796: Remove get_product_* from globals.pl - Patch by Frédéric Buclin r=wicked a=justdave MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- collectstats.pl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'collectstats.pl') diff --git a/collectstats.pl b/collectstats.pl index 9325b0540..4d000f0c1 100755 --- a/collectstats.pl +++ b/collectstats.pl @@ -54,6 +54,8 @@ if (chdir("graphs")) { GetVersionTable(); +# Let Throw*Error() work correctly outside a web browser. +Bugzilla->batch(1); Bugzilla->switch_to_shadow_db(); # To recreate the daily statistics, run "collectstats.pl --regenerate" . @@ -125,10 +127,13 @@ sub collect_stats { my $dir = shift; my $product = shift; my $when = localtime (time); - my $product_id = get_product_id($product) unless $product eq '-All-'; my $dbh = Bugzilla->dbh; - die "Unknown product $product" unless ($product_id or $product eq '-All-'); + my $product_id; + if ($product ne '-All-') { + my $prod = Bugzilla::Product::check_product($product); + $product_id = $prod->id; + } # NB: Need to mangle the product for the filename, but use the real # product name in the query -- cgit v1.2.3-24-g4f1b