From: ivan Date: Tue, 5 Aug 2003 18:45:11 +0000 (+0000) Subject: backwards compatibility if the schema hasn't been updated X-Git-Tag: NET_WHOIS_RAW_0_31~454 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=49ba3cd359748f5fa3e1b0087840a23c5838d1ab backwards compatibility if the schema hasn't been updated --- 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 ' .