projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
56edd58
)
when enumerating the subsets of a set, include the null set, #27973
author
Mark Wells
<mark@freeside.biz>
Thu, 20 Mar 2014 18:52:28 +0000
(11:52 -0700)
committer
Mark Wells
<mark@freeside.biz>
Thu, 20 Mar 2014 18:52:28 +0000
(11:52 -0700)
FS/FS/part_pkg_report_option.pm
patch
|
blob
|
history
diff --git
a/FS/FS/part_pkg_report_option.pm
b/FS/FS/part_pkg_report_option.pm
index
372b119
..
e3c353a
100644
(file)
--- 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;
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
}
=back