fix delete order to avoid foreign key trouble, #13971
authorMark Wells <mark@freeside.biz>
Wed, 9 Jul 2014 00:02:12 +0000 (17:02 -0700)
committerMark Wells <mark@freeside.biz>
Wed, 9 Jul 2014 00:02:12 +0000 (17:02 -0700)
FS/FS/svc_Radius_Mixin.pm

index 969f749..8e53a15 100644 (file)
@@ -99,12 +99,12 @@ sub delete {
   local $FS::UID::AutoCommit = 0;
   my $dbh = dbh;
 
-  my $error =  $self->SUPER::delete(@_)
-            || $self->process_m2m(
+  my $error =  $self->process_m2m(
                                    'link_table'   => 'radius_usergroup',
                                    'target_table' => 'radius_group',
                                    'params'       => [],
-                                 );
+                                 )
+            || $self->SUPER::delete;
 
   if ( $error ) {
     $dbh->rollback if $oldAutoCommit;