diff options
author | 2010-07-07 03:58:10 +0200 | |
---|---|---|
committer | 2010-07-07 03:58:10 +0200 | |
commit | 814b24fdc9407a741967322041ff817665f8e00b (patch) | |
tree | 8137af19b7fbb04b8966c959f56b78be98b4e404 /collectstats.pl | |
parent | Bug 576911 The admin/components/list.html template was using "component" (diff) | |
download | bugzilla-814b24fdc9407a741967322041ff817665f8e00b.tar.gz bugzilla-814b24fdc9407a741967322041ff817665f8e00b.tar.bz2 bugzilla-814b24fdc9407a741967322041ff817665f8e00b.zip |
Bug 519835: Remove Bugzilla::Product::check_product() in favor of Bugzilla::Product->check()
r=mkanat a=LpSolit
Diffstat (limited to 'collectstats.pl')
-rwxr-xr-x | collectstats.pl | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/collectstats.pl b/collectstats.pl index 733a1e4f1..af055ab32 100755 --- a/collectstats.pl +++ b/collectstats.pl @@ -70,9 +70,6 @@ if ($#ARGV >= 0 && $ARGV[0] eq "--regenerate") { my $datadir = bz_locations()->{'datadir'}; -my @myproducts = map {$_->name} Bugzilla::Product->get_all; -unshift(@myproducts, "-All-"); - # As we can now customize statuses and resolutions, looking at the current list # of legal values only is not enough as some now removed statuses and resolutions # may have existed in the past, or have been renamed. We want them all. @@ -142,6 +139,10 @@ if ($regenerate) { } my $tstart = time; + +my @myproducts = Bugzilla::Product->get_all; +unshift(@myproducts, "-All-"); + foreach (@myproducts) { my $dir = "$datadir/mining"; @@ -173,11 +174,11 @@ sub collect_stats { my $product = shift; my $when = localtime (time); my $dbh = Bugzilla->dbh; - my $product_id; - if ($product ne '-All-') { - my $prod = Bugzilla::Product::check_product($product); - $product_id = $prod->id; + + if (ref $product) { + $product_id = $product->id; + $product = $product->name; } # NB: Need to mangle the product for the filename, but use the real @@ -312,6 +313,9 @@ sub regenerate_stats { # NB: Need to mangle the product for the filename, but use the real # product name in the query + if (ref $product) { + $product = $product->name; + } my $file_product = $product; $file_product =~ s/\//-/gs; my $file = join '/', $dir, $file_product; |