From ca52174cfeb8957c4f49654d5428ae2c3096951b Mon Sep 17 00:00:00 2001 From: dave Date: Sun, 30 Dec 2007 20:03:05 +0000 Subject: [PATCH] - Fix the grouping logic to handle the case where the group by column is also selected as part of the display columns --- admin/reports.inc.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/admin/reports.inc.php b/admin/reports.inc.php index 0861e48..4f882e2 100644 --- a/admin/reports.inc.php +++ b/admin/reports.inc.php @@ -650,11 +650,13 @@ foreach($report_stock as $n=>$v) { if($n_groups > 0) { $group_change = false; - for($x=0; $x<$n_groups; $x++) { - if($last_group_data["G$x"] != $i["G$x"]) { + /* See if any of the "group" fields have changed */ + foreach($report['group'] as $x=>$g) { + $f = $g['field']; + $c = $fieldname[$f]; + if($last_group_data[$c] != $i[$c]) $group_change = true; - } - $last_group_data["G$x"] = $i["G$x"]; + $last_group_data[$c] = $i[$c]; } if($group_change) {