From 49ba3cd359748f5fa3e1b0087840a23c5838d1ab Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 5 Aug 2003 18:45:11 +0000 Subject: [PATCH] backwards compatibility if the schema hasn't been updated --- FS/FS/Record.pm | 6 ++++-- 1 file 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 ' . -- 2.11.0