From: Ivan Kohler Date: Mon, 30 Dec 2013 02:23:02 +0000 (-0800) Subject: still report errant AUTOLOAD triggering in the new world of FKs, RT#13971 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=5221eadfdb1a8faa0b46e8a8577876fb8d67fb37 still report errant AUTOLOAD triggering in the new world of FKs, RT#13971 --- diff --git a/FS/FS/Record.pm b/FS/FS/Record.pm index 835b73d8f..39a392013 100644 --- a/FS/FS/Record.pm +++ b/FS/FS/Record.pm @@ -979,6 +979,9 @@ sub AUTOLOAD { my($field)=$AUTOLOAD; $field =~ s/.*://; + confess "errant AUTOLOAD $field for $self (arg $value)" + unless blessed($self) && $self->can('setfield'); + #$fk_method_cache{$self->table} ||= fk_methods($self->table); if ( exists($fk_method_cache{$self->table}->{$field}) ) { @@ -1006,12 +1009,8 @@ sub AUTOLOAD { } if ( defined($value) ) { - confess "errant AUTOLOAD $field for $self (arg $value)" - unless blessed($self) && $self->can('setfield'); $self->setfield($field,$value); } else { - confess "errant AUTOLOAD $field for $self (no args)" - unless blessed($self) && $self->can('getfield'); $self->getfield($field); } }