X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_pkg.pm;h=661625725850d58c810ef5cc1ecf8eae1923556a;hb=7d38afc8a7175c836721400f3b08f84f1c20ea4f;hp=4ad963956a8b48c98872a289b60d41a28c3079e3;hpb=bb174fcb28d7df1673a9c55edc7d953017b5288f;p=freeside.git diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm index 4ad963956..661625725 100644 --- a/FS/FS/cust_pkg.pm +++ b/FS/FS/cust_pkg.pm @@ -1265,7 +1265,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'});