summaryrefslogtreecommitdiff
path: root/FS/FS/option_Common.pm
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2014-02-24 19:11:34 -0800
committerMark Wells <mark@freeside.biz>2014-02-24 19:11:34 -0800
commitcf69a36faa57cdb544948c905059cf1e1ac73e07 (patch)
treec32639fed4f7cc956a9c574802df7d6aec3ce529 /FS/FS/option_Common.pm
parentcc3a43f7d4386297a8babebfdd49646f836db127 (diff)
fix deletion of objects with options, fallout from #13971
Diffstat (limited to 'FS/FS/option_Common.pm')
-rw-r--r--FS/FS/option_Common.pm14
1 files changed, 7 insertions, 7 deletions
diff --git a/FS/FS/option_Common.pm b/FS/FS/option_Common.pm
index c1dda22..74adbed 100644
--- a/FS/FS/option_Common.pm
+++ b/FS/FS/option_Common.pm
@@ -134,13 +134,7 @@ sub delete {
my $oldAutoCommit = $FS::UID::AutoCommit;
local $FS::UID::AutoCommit = 0;
my $dbh = dbh;
-
- my $error = $self->SUPER::delete;
- if ( $error ) {
- $dbh->rollback if $oldAutoCommit;
- return $error;
- }
-
+
my $pkey = $self->primary_key;
#my $option_table = $self->option_table;
@@ -152,6 +146,12 @@ sub delete {
}
}
+ my $error = $self->SUPER::delete;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+
$dbh->commit or die $dbh->errstr if $oldAutoCommit;
'';