diff options
-rw-r--r-- | FS/FS/Record.pm | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/FS/FS/Record.pm b/FS/FS/Record.pm index 9d82d949b..1fe51e065 100644 --- a/FS/FS/Record.pm +++ b/FS/FS/Record.pm @@ -1369,12 +1369,14 @@ be exported, and should only be called as an instance or class method. =cut sub virtual_fields { - my $something = shift; + my $self = shift; my $table; - $table = $something->table or confess "virtual_fields called on non-table"; + $table = $self->table or confess "virtual_fields called on non-table"; confess "Unknown table $table" unless $dbdef->table($table); + return () unless $self->dbdef->table('part_virtual_field'); + # This should be smart enough to cache results. my $query = 'SELECT name from part_virtual_field ' . |