summaryrefslogtreecommitdiffstats
path: root/collectstats.pl
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2006-06-18 08:12:35 +0200
committerlpsolit%gmail.com <>2006-06-18 08:12:35 +0200
commit0d2869cdc8bf59db57e80e7e3a0c0c377fc0ffb5 (patch)
tree03ab21ba894bffea01fb977c93b4ede6f553742f /collectstats.pl
parentd9548f66b0f47af651f8fa62fa69cc7e65df0a60 (diff)
downloadbugzilla-0d2869cdc8bf59db57e80e7e3a0c0c377fc0ffb5.tar.gz
bugzilla-0d2869cdc8bf59db57e80e7e3a0c0c377fc0ffb5.tar.xz
Bug 338796: Remove get_product_* from globals.pl - Patch by Frédéric Buclin <LpSolit@gmail.com> r=wicked a=justdave
Diffstat (limited to 'collectstats.pl')
-rwxr-xr-xcollectstats.pl9
1 files changed, 7 insertions, 2 deletions
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