summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2006-02-07 18:29:27 +0100
committerlpsolit%gmail.com <>2006-02-07 18:29:27 +0100
commit10272c25189c97257eba249340a2c505c1a17725 (patch)
tree8c57b277888c32e9b8a270e4474e2a57fbb88bd1
parentd9c4143562bf8e887684b9ea56b49dc6f682db4d (diff)
downloadbugzilla-10272c25189c97257eba249340a2c505c1a17725.tar.gz
bugzilla-10272c25189c97257eba249340a2c505c1a17725.tar.xz
Bug 313806: Whine E-mails do not "Order" the Queries Correctly - Patch by Frédéric Buclin <LpSolit@gmail.com> r=wurblzap a=justdave
-rwxr-xr-xwhine.pl21
1 files changed, 11 insertions, 10 deletions
diff --git a/whine.pl b/whine.pl
index 5a04502ac..36c405d15 100755
--- a/whine.pl
+++ b/whine.pl
@@ -51,7 +51,7 @@ my @seen_schedules = ();
# allow the database to keep their SQL compiled.
my $sth_run_queries =
$dbh->prepare("SELECT " .
- "id, query_name, title, onemailperbug " .
+ "query_name, title, onemailperbug " .
"FROM whine_queries " .
"WHERE eventid=? " .
"ORDER BY sortkey");
@@ -425,18 +425,19 @@ sub run_queries {
my $return_queries = [];
$sth_run_queries->execute($args->{'eventid'});
- my $queries = {};
+ my @queries = ();
for (@{$sth_run_queries->fetchall_arrayref}) {
- $queries->{$_->[0]} = {
- 'name' => $_->[1],
- 'title' => $_->[2],
- 'onemailperbug' => $_->[3],
- 'bugs' => [],
- };
+ push(@queries,
+ {
+ 'name' => $_->[0],
+ 'title' => $_->[1],
+ 'onemailperbug' => $_->[2],
+ 'bugs' => [],
+ }
+ );
}
- for my $query_id (keys %{$queries}) {
- my $thisquery = $queries->{$query_id};
+ foreach my $thisquery (@queries) {
next unless $thisquery->{'name'}; # named query is blank
my $savedquery = get_query($thisquery->{'name'}, $args->{'author'});