[freeside-commits] branch master updated. 8227e787f6b012c3e9f2967bdf61fcd0acd4e622

Ivan ivan at 420.am
Fri Jan 16 18:41:13 PST 2015


The branch, master has been updated
       via  8227e787f6b012c3e9f2967bdf61fcd0acd4e622 (commit)
       via  e1cac73de0b294dd3baeb792509fbf089fe981d3 (commit)
       via  2b22859ec037627196e3153719359efe46e42178 (commit)
      from  b7cf1606a66cca95e3540f803ffa66d223f23a40 (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 8227e787f6b012c3e9f2967bdf61fcd0acd4e622
Merge: b7cf160 e1cac73
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Fri Jan 16 18:38:17 2015 -0800

    Merge branch 'jgoodman-fix_category_table'


commit e1cac73de0b294dd3baeb792509fbf089fe981d3
Merge: b7cf160 2b22859
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Fri Jan 16 18:38:06 2015 -0800

    Merge branch 'fix_category_table' of https://github.com/jgoodman/Freeside into jgoodman-fix_category_table


commit 2b22859ec037627196e3153719359efe46e42178
Author: Joshua Goodman <jgoodman1990 at gmail.com>
Date:   Fri Jan 16 00:25:37 2015 +0000

    Change $_category_table to be a hash which maps packages to category tables. A bug was found where "part_svc_category" was returned when FS::part_pkg->insert() was called.

diff --git a/FS/FS/class_Common.pm b/FS/FS/class_Common.pm
index 455cb9f..01048ec 100644
--- a/FS/FS/class_Common.pm
+++ b/FS/FS/class_Common.pm
@@ -122,14 +122,15 @@ sub _target_table {
 
 sub _target_column { 'classnum'; }
 
-use vars qw( $_category_table );
+use vars qw( %_category_table );
 sub _category_table {
-  return $_category_table if $_category_table;
   my $self = shift;
-  $_category_table = $self->table;
-  $_category_table =~ s/class/category/ # s/_class$/_category/
-    or die "can't determine an automatic category table for $_category_table";
-  $_category_table;
+  return $_category_table{ ref $self } ||= do {
+    my $category_table = $self->table;
+    $category_table =~ s/class/category/ # s/_class$/_category/
+      or die "can't determine an automatic category table for $category_table";
+    $category_table;
+  }
 }
 
 =head1 BUGS

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

Summary of changes:
 FS/FS/class_Common.pm |   13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)




More information about the freeside-commits mailing list