summaryrefslogtreecommitdiff
path: root/FS/FS/cust_pkg.pm
diff options
context:
space:
mode:
authorJonathan Prykop <jonathan@freeside.biz>2016-07-05 18:35:41 -0500
committerJonathan Prykop <jonathan@freeside.biz>2016-07-07 18:43:41 -0500
commitfba4614e057708bc585b869a517938f29bff25d8 (patch)
tree594d8ed8c3f7aff4142076cbaa025eaa7f013444 /FS/FS/cust_pkg.pm
parentf23b09e7f67e0975958bdbbf4209f7c9d5cca38e (diff)
RT#17599: display cancelled services from history [bug fixes]
Diffstat (limited to 'FS/FS/cust_pkg.pm')
-rw-r--r--FS/FS/cust_pkg.pm8
1 files changed, 7 insertions, 1 deletions
diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm
index cd801d9..9d20fd6 100644
--- a/FS/FS/cust_pkg.pm
+++ b/FS/FS/cust_pkg.pm
@@ -1272,7 +1272,13 @@ sub uncancel_svc_summary {
'uncancel_svcnum' => $svc_x->get('_h_svc_x')->svcnum,
};
$svc_x->pkgnum($self->pkgnum); # provisioning services on a canceled package, will be rolled back
- if ($opt{'no_test_reprovision'} or $svc_x->insert) {
+ my $insert_error;
+ unless ($opt{'no_test_reprovision'}) {
+ # avoid possibly fatal errors from missing linked records
+ eval { $insert_error = $svc_x->insert };
+ $insert_error ||= $@;
+ }
+ if ($opt{'no_test_reprovision'} or $insert_error) {
# avoid possibly fatal errors from missing linked records
eval { $out->{'label'} = $svc_x->label };
eval { $out->{'label'} = $svc_x->get('_h_svc_x')->label } unless defined($out->{'label'});