From: ivan Date: Thu, 13 Mar 2008 09:14:58 +0000 (+0000) Subject: infinite loop protection X-Git-Tag: TRIXBOX_2_6~24 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=63065c617f83c9da147bf84a368b1d6886d16bf1 infinite loop protection --- diff --git a/FS/FS/cust_pay.pm b/FS/FS/cust_pay.pm index de14610d6..0507276f4 100644 --- a/FS/FS/cust_pay.pm +++ b/FS/FS/cust_pay.pm @@ -687,6 +687,7 @@ sub _upgrade_data { #class method my $count = 0; my $lastprog = 0; + my %seen = (); while (1) { my $cust_pay = qsearchs( { @@ -698,6 +699,8 @@ sub _upgrade_data { #class method return unless $cust_pay; + next if $seen{$cust_pay->paynum}++; + my $h_cust_pay = $cust_pay->h_search('insert'); if ( $h_cust_pay ) { $cust_pay->otaker($h_cust_pay->history_user); @@ -708,13 +711,11 @@ sub _upgrade_data { #class method delete $FS::payby::hash{'COMP'}->{cust_pay}; #quelle kludge my $error = $cust_pay->replace; - #infinite... - #if ( $error ) { - # warn " *** WARNING: Error updaating order taker for payment paynum". - # $cust_pay->paynun. ": $error\n"; - # next; - #} - die $error if $error; + if ( $error ) { + warn " *** WARNING: Error updaating order taker for payment paynum". + $cust_pay->paynun. ": $error\n"; + next; + } $FS::payby::hash{'COMP'}->{cust_pay} = ''; #restore it