Bu 210735 - collectstats.pl broken. Removes "uninitialised value" warning. Patch by gerv; r=bbaetz, a=justdave.

This commit is contained in:
gerv%gerv.net 2003-11-02 15:22:42 +00:00
Родитель 0c55888e97
Коммит a9386051c2
2 изменённых файлов: 5 добавлений и 6 удалений

Просмотреть файл

@ -58,6 +58,7 @@ sub init {
my $self = shift;
my $fieldsref = $self->{'fields'};
my $params = $self->{'params'};
my $user = $self->{'user'} || Bugzilla->user;
my $debug = 0;
@ -991,8 +992,6 @@ sub init {
# Make sure we create a legal SQL query.
@andlist = ("1 = 1") if !@andlist;
my $user = Bugzilla->user;
my $query = "SELECT " . join(', ', @fields) .
" FROM $suppstring" .
" LEFT JOIN bug_group_map " .

Просмотреть файл

@ -441,7 +441,7 @@ sub CollectSeriesData {
CleanupChartTables() if ($days_since_epoch % 7 == 0);
my $dbh = Bugzilla->dbh;
my $serieses = $dbh->selectall_hashref("SELECT series_id, query " .
my $serieses = $dbh->selectall_hashref("SELECT series_id, query, creator " .
"FROM series " .
"WHERE frequency != 0 AND " .
"($days_since_epoch + series_id) % frequency = 0",
@ -455,12 +455,12 @@ sub CollectSeriesData {
foreach my $series_id (keys %$serieses) {
# We set up the user for Search.pm's permission checking - each series
# runs with the permissions of its creator.
$::vars->{'user'} =
new Bugzilla::User($serieses->{$series_id}->{'creator'});
my $user = new Bugzilla::User($serieses->{$series_id}->{'creator'});
my $cgi = new Bugzilla::CGI($serieses->{$series_id}->{'query'});
my $search = new Bugzilla::Search('params' => $cgi,
'fields' => ["bugs.bug_id"]);
'fields' => ["bugs.bug_id"],
'user' => $user);
my $sql = $search->getSQL();
# We need to count the returned rows. Without subselects, we can't