Commit 10272c25 authored by lpsolit%gmail.com's avatar lpsolit%gmail.com

Bug 313806: Whine E-mails do not "Order" the Queries Correctly - Patch by…

Bug 313806: Whine E-mails do not "Order" the Queries Correctly - Patch by Frédéric Buclin <LpSolit@gmail.com> r=wurblzap a=justdave
parent d9c41435
...@@ -51,7 +51,7 @@ my @seen_schedules = (); ...@@ -51,7 +51,7 @@ my @seen_schedules = ();
# allow the database to keep their SQL compiled. # allow the database to keep their SQL compiled.
my $sth_run_queries = my $sth_run_queries =
$dbh->prepare("SELECT " . $dbh->prepare("SELECT " .
"id, query_name, title, onemailperbug " . "query_name, title, onemailperbug " .
"FROM whine_queries " . "FROM whine_queries " .
"WHERE eventid=? " . "WHERE eventid=? " .
"ORDER BY sortkey"); "ORDER BY sortkey");
...@@ -425,18 +425,19 @@ sub run_queries { ...@@ -425,18 +425,19 @@ sub run_queries {
my $return_queries = []; my $return_queries = [];
$sth_run_queries->execute($args->{'eventid'}); $sth_run_queries->execute($args->{'eventid'});
my $queries = {}; my @queries = ();
for (@{$sth_run_queries->fetchall_arrayref}) { for (@{$sth_run_queries->fetchall_arrayref}) {
$queries->{$_->[0]} = { push(@queries,
'name' => $_->[1], {
'title' => $_->[2], 'name' => $_->[0],
'onemailperbug' => $_->[3], 'title' => $_->[1],
'bugs' => [], 'onemailperbug' => $_->[2],
}; 'bugs' => [],
}
);
} }
for my $query_id (keys %{$queries}) { foreach my $thisquery (@queries) {
my $thisquery = $queries->{$query_id};
next unless $thisquery->{'name'}; # named query is blank next unless $thisquery->{'name'}; # named query is blank
my $savedquery = get_query($thisquery->{'name'}, $args->{'author'}); my $savedquery = get_query($thisquery->{'name'}, $args->{'author'});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment