}
if ( $opt{show_combined} ) {
- # set up group 0 as a combined view
- unshift @groups, $totals;
- unshift @group_labels, 'All ' . PL($opt{name_singular}) .
- ' (' . $totals->num_rows . ')';
- unshift @group_footers, []; # the total footer will suffice
- unshift @queries, $base_query->clone;
+ if ( @groups > 1 ) {
+ # set up group 0 as a combined view
+ unshift @groups, $totals;
+ unshift @group_labels, 'All ' . PL($opt{name_singular}) .
+ ' (' . $totals->num_rows . ')';
+ unshift @group_footers, []; # the total footer will suffice
+ unshift @queries, $base_query->clone;
+ }
}
my @total_footer;