X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FRecord.pm;h=4a0fe3fd2089b20e5494dacbfd9b2ab4740a9a5c;hb=a5a4afbb77bbdffc25ae94d10b645b0bcc76e859;hp=887c8dcd4a302f9877cbb6d3cd425accf3451ad1;hpb=0f37b9c32e41fd94a0d5ea2f895a737cf674f310;p=freeside.git diff --git a/FS/FS/Record.pm b/FS/FS/Record.pm index 887c8dcd4..4a0fe3fd2 100644 --- a/FS/FS/Record.pm +++ b/FS/FS/Record.pm @@ -250,7 +250,7 @@ sub qsearch { my $table = $cache ? $cache->table : $stable; my $dbdef_table = dbdef->table($table) or die "No schema for table $table found - ". - "do you need to create it or run dbdef-create?"; + "do you need to run freeside-upgrade?"; my $pkey = $dbdef_table->primary_key; my @real_fields = grep exists($record->{$_}), real_fields($table); @@ -977,6 +977,11 @@ sub replace { warn "[debug]$me $new ->replace $old\n" if $DEBUG; + if ( $new->can('replace_check') ) { + my $error = $new->replace_check($old); + return $error if $error; + } + return "Records not in same table!" unless $new->table eq $old->table; my $primary_key = $old->dbdef_table->primary_key;