X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fclass_Common.pm;h=01048ec654dc9e269aa6cd75b110bd5e1cdb7a6d;hp=5ee8208f472c99fa94dd1eb34d4e9dac337749db;hb=ffa18709ee8a4d05e18d2d406cf73afe79e52524;hpb=b5c4237a34aef94976bc343c8d9e138664fc3984 diff --git a/FS/FS/class_Common.pm b/FS/FS/class_Common.pm index 5ee8208f4..01048ec65 100644 --- a/FS/FS/class_Common.pm +++ b/FS/FS/class_Common.pm @@ -68,7 +68,7 @@ returns the error, otherwise returns false. =item check -Checks all fields to make sure this is a valid package classification. If +Checks all fields to make sure this is a valid classification. If there is an error, returns the error, otherwise returns false. Called by the insert and replace methods. @@ -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