summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorivan <ivan>2007-01-30 19:45:51 +0000
committerivan <ivan>2007-01-30 19:45:51 +0000
commit655b4043942c7d361224d283accb4c2a02ef7359 (patch)
tree53cf106632317c179f82bfea7b783e80037f26b4
parentb201bef650fd5818943fcb7ecd123767b1fbcbc3 (diff)
fix old-record detection bug in option_Common
-rw-r--r--FS/FS/option_Common.pm4
1 files changed, 3 insertions, 1 deletions
diff --git a/FS/FS/option_Common.pm b/FS/FS/option_Common.pm
index 9a44561a0..2950b28d4 100644
--- a/FS/FS/option_Common.pm
+++ b/FS/FS/option_Common.pm
@@ -2,6 +2,7 @@ package FS::option_Common;
use strict;
use vars qw( @ISA $DEBUG );
+use Scalar::Util qw( blessed );
use FS::Record qw( qsearch qsearchs dbh );
@ISA = qw( FS::Record );
@@ -161,7 +162,7 @@ created or modified (see L<FS::part_export_option>).
sub replace {
my $self = shift;
- my $old = ( ref($_[0]) eq ref($self) )
+ my $old = ( blessed($_[0]) && $_[0]->isa('FS::Record') )
? shift
: $self->replace_old;
@@ -169,6 +170,7 @@ sub replace {
( ref($_[0]) eq 'HASH' )
? shift
: { @_ };
+
warn "FS::option_Common::replace called on $self with options ".
join(', ', map "$_ => ". $options->{$_}, keys %$options)
if $DEBUG;