backwards compatibility if the schema hasn't been updated
authorivan <ivan>
Tue, 5 Aug 2003 18:45:11 +0000 (18:45 +0000)
committerivan <ivan>
Tue, 5 Aug 2003 18:45:11 +0000 (18:45 +0000)
FS/FS/Record.pm

index 9d82d94..1fe51e0 100644 (file)
@@ -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 ' .