summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2014-03-20 11:52:14 -0700
committerMark Wells <mark@freeside.biz>2014-03-20 11:52:14 -0700
commit4fbac69c76d393adc7221c036a996a2ab1b860f1 (patch)
treef8afa6fd4e9fc3d9c5e2f7e6d8e81093e83aaa6f
parent87829bfd7466f835e5d4bd37e6c8b0d03a0daed9 (diff)
when enumerating the subsets of a set, include the null set, #27973
-rw-r--r--FS/FS/part_pkg_report_option.pm10
1 files changed, 7 insertions, 3 deletions
diff --git a/FS/FS/part_pkg_report_option.pm b/FS/FS/part_pkg_report_option.pm
index 372b11930..e3c353a2c 100644
--- a/FS/FS/part_pkg_report_option.pm
+++ b/FS/FS/part_pkg_report_option.pm
@@ -146,9 +146,13 @@ sub subsets {
or die $dbh->errstr; # seriously, this should never happen
$sth->execute
or die $sth->errstr;
- # return the first (only) column
- map { [ split(',',$_->[0]) ],
- [ split(',',$_->[1]) ] } @{ $sth->fetchall_arrayref };
+ # return a pair of entries for the null set (conventionally we use zero
+ # for that)
+ ( [ 0 ], [ '(empty class)' ],
+ # followed by the first two columns: report class numbers and names
+ map { [ split(',',$_->[0]) ],
+ [ split(',',$_->[1]) ] } @{ $sth->fetchall_arrayref }
+ );
}
=back