From: ivan Date: Fri, 7 Dec 2007 01:08:46 +0000 (+0000) Subject: doh! is not an object. let's call it , mmkay X-Git-Tag: TRIXBOX_2_6~187 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=ef1cea786afc0f1cebd7c2d12f032d50baffc20f doh! is not an object. let's call it , mmkay --- diff --git a/FS/FS/cust_credit.pm b/FS/FS/cust_credit.pm index 6cbe1d046..96bf8efae 100644 --- a/FS/FS/cust_credit.pm +++ b/FS/FS/cust_credit.pm @@ -410,15 +410,15 @@ sub reason { # sub _upgrade_data { # class method - my ($self, %opts) = @_; + my ($class, %opts) = @_; - warn "$me upgrading $self\n" if $DEBUG; + warn "$me upgrading $class\n" if $DEBUG; - if (defined dbdef->table($self->table)->column('reason')) { + if (defined dbdef->table($class->table)->column('reason')) { warn "$me Checking for unmigrated reasons\n" if $DEBUG; - my @cust_credits = qsearch({ 'table' => $self->table, + my @cust_credits = qsearch({ 'table' => $class->table, 'hashref' => {}, 'extrasql' => 'WHERE reason IS NOT NULL', }); @@ -430,7 +430,7 @@ sub _upgrade_data { # class method unless ($reason_type) { $reason_type = new FS::reason_type( $hashref ); my $error = $reason_type->insert(); - die "$self had error inserting FS::reason_type into database: $error\n" + die "$class had error inserting FS::reason_type into database: $error\n" if $error; } @@ -458,8 +458,8 @@ sub _upgrade_data { # class method $cust_credit->setfield('reason', ''); my $error = $cust_credit->replace; - warn "*** WARNING: error replacing reason in $self ". - $self->crednum. ": $error ***\n" + warn "*** WARNING: error replacing reason in $class ". + $cust_credit->crednum. ": $error ***\n" if $error; } } @@ -475,7 +475,7 @@ sub _upgrade_data { # class method unless ($reason_type) { $reason_type = new FS::reason_type( $hashref ); my $error = $reason_type->insert(); - die "$self had error inserting FS::reason_type into database: $error\n" + die "$class had error inserting FS::reason_type into database: $error\n" if $error; } # or clause for 1.7.x @@ -490,7 +490,7 @@ sub _upgrade_data { # class method unless ($reason_type) { $reason_type = new FS::reason_type( $hashref ); my $error = $reason_type->insert(); - die "$self had error inserting FS::reason_type into database: $error\n" + die "$class had error inserting FS::reason_type into database: $error\n" if $error; }