[freeside-commits] branch master updated. ffa69be333d69d99fb10232f3ee3a5847b6e9d93

Mark Wells mark at 420.am
Thu Mar 20 11:53:24 PDT 2014


The branch, master has been updated
       via  ffa69be333d69d99fb10232f3ee3a5847b6e9d93 (commit)
      from  56edd581cc007c2c94fba2d81ce2d4829355df1f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit ffa69be333d69d99fb10232f3ee3a5847b6e9d93
Author: Mark Wells <mark at freeside.biz>
Date:   Thu Mar 20 11:52:28 2014 -0700

    when enumerating the subsets of a set, include the null set, #27973

diff --git a/FS/FS/part_pkg_report_option.pm b/FS/FS/part_pkg_report_option.pm
index 372b119..e3c353a 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

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/part_pkg_report_option.pm |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)




More information about the freeside-commits mailing list