summaryrefslogtreecommitdiff
path: root/FS/FS/cust_svc.pm
diff options
context:
space:
mode:
Diffstat (limited to 'FS/FS/cust_svc.pm')
-rw-r--r--FS/FS/cust_svc.pm14
1 files changed, 7 insertions, 7 deletions
diff --git a/FS/FS/cust_svc.pm b/FS/FS/cust_svc.pm
index 7ee9b3f40..118ab79d2 100644
--- a/FS/FS/cust_svc.pm
+++ b/FS/FS/cust_svc.pm
@@ -172,15 +172,9 @@ sub replace {
local $FS::UID::AutoCommit = 0;
my $dbh = dbh;
- my $error = $new->SUPER::replace($old);
- if ( $error ) {
- $dbh->rollback if $oldAutoCommit;
- return $error if $error;
- }
-
if ( $new->svcpart != $old->svcpart ) {
my $svc_x = $new->svc_x;
- my $new_svc_x = ref($svc_x)->new({$svc_x->hash});
+ my $new_svc_x = ref($svc_x)->new({$svc_x->hash, svcpart=>$new->svcpart });
my $error = $new_svc_x->replace($svc_x);
if ( $error ) {
$dbh->rollback if $oldAutoCommit;
@@ -188,6 +182,12 @@ sub replace {
}
}
+ my $error = $new->SUPER::replace($old);
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error if $error;
+ }
+
$dbh->commit or die $dbh->errstr if $oldAutoCommit;
''; #no error