[freeside-devel] [freeside-commits] freeside/FS/FS cust_credit.pm, 1.27, 1.28
Ivan Kohler
ivan at sisd.com
Thu Dec 6 17:40:56 PST 2007
On Thu, Dec 06, 2007 at 08:27:48PM -0500, Jeff Finucane wrote:
> "Ivan,,," <ivan at wavetail.420.am>:
>
> Thank you for your message of Fri, 07 Dec 2007 01:05:05 +0000....
>
> +----------
> | From: "Ivan,,," <ivan at wavetail.420.am>
> | To: ivan-freeside-commits at sisd.com
> | Message-Id: <20071207010505.D409EFC8269 at wavetail.420.am>
> | Subject: [freeside-commits] freeside/FS/FS cust_credit.pm,1.27,1.28
> |
> | Modified Files:
> | cust_credit.pm
> | Log Message:
> | some old databases may have 'hanging' cust_credit records; we don't want to abort the upgrade because of that, just warn
> |
> | Index: cust_credit.pm
> | ===================================================================
> | RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_credit.pm,v
> | retrieving revision 1.27
> | retrieving revision 1.28
> | diff -u -d -r1.27 -r1.28
> | --- cust_credit.pm 4 Dec 2007 18:20:56 -0000 1.27
> | +++ cust_credit.pm 7 Dec 2007 01:04:59 -0000 1.28
> | @@ -458,7 +458,8 @@
> | $cust_credit->setfield('reason', '');
> | my $error = $cust_credit->replace;
> |
> | - die "error inserting $self into database: $error\n"
> | + warn "*** WARNING: error replacing reason in $self ".
> | + $self->crednum. ": $error ***\n"
> | if $error;
> | }
> | }
> +----------
>
> Sure about this? I am not certain what you mean by "hanging"... do
> you mean it won't pass ::check() for lack of find a cust_main?
Right. That shouldn't happen (and hasn't in years AFAIK), but I
need to upgrade at least one old database with records like this.
What alternative would you suggest? Modify cust_credit::check to ignore
missing custnums ("local($ignore_custnum_check) = 1" or something) so
the reasons can migrate?
> As a practical matter, your change means upgrade completes, the reasons
> disappear from the UI,
Well, just for the old credits that aren't attached to a customer
record. :)
> and the warnings are issued again on a subsequent upgrade run.
Well, they should probably be cleaned up at some point anyway...
--
_ivan
More information about the freeside-devel
mailing list